Partners filmexxx.link, sextotal.net, ahmedxnxx.com, https://xnxx1xvideo.com, russianxnxx

In this post, I’ll talk about an interesting and frankly quite simple, data modeling trick to display the table or the matrix until a selected date. Something like this

Display Table or Matrix Until the Selected Date

 

Display the Table Until the Selected Date – Video

 

Consider this Pivot

We have a pivot Table containing month and year against total sales measure. The year and month column have also been used on a slicer.

Display Table or Matrix Until the Selected Date- Slicer

 

The Problem – Selecting March 2003 (or any month) in the slicer will display the sales of that particular month. However, we want the table to display total sales until the month selected.

 

The slicer should show the values until the Date Selected and not the values of the period selected.

Let's see how we can do this!

 

Creating a Disconnected Date Table

I am using the same code for the Calendar table once again to create a new table – Disconnected Calendar. This table won’t be linked to any other table.

Display Table or Matrix Until the Selected Date- Data Model

Now, let’s use Year and Month Columns from the disconnected table in the slicer (and not from the linked Calendar Table). 

Let’s also create a new measure Stop Date.

Stop Date = MAX ( 'Disconnected Calendar'[Date] )

This measure returns the last date of the month selected on the slicer.

 

Modifying the Calculation to display Till Date Values

Change the Total Sales Calculation as follows

Total Sales =
CALCULATE (
    SUM ( Sales[SalesAmount] ),
    FILTER (
        'Calendar',
        'Calendar'[Date] <= [Stop Date] -- Display the period until the selected date
    )
)

Now any selections made in the slicer will display the total sales until that month.

Display Table or Matrix Until the Selected Date

 

    ⬇️ Pop in your Name & Email to get the file!


     

    More on DAX

    Summing Visible Values of a Table in Power BI

    Display Top N items and Others in Power BI

    Find Missing Values from Lookup Tables in Power BI

    Use Measures in Columns of a Matrix Visual

    Switch between Current Period and YTD Calculation

    Tagged In .


    Topics that I write about...