Forum Discussion

jeremy_R_b's avatar
jeremy_R_b
Frequent Visitor
8 years ago
Solved

Finding the difference between two amounts within a slicer range

Hello all, I'm very new to DAX and fairly new to Power BI in general.  I have done a lot of searching and it may be I'm not phrasing my question correctly but I just can't seem to find the solution t...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    8 years ago

    Hi,

     

    Try this

     

    =CALCULATE(SUM(your_measure),FILTER(Data,Data[snapshotdate]=MAX(calendar[date])))-

    CALCULATE(SUM(your_measure),FILTER(Data,Data[snapshotdate]=MIN(calendar[date])))

     

    Ensure the following:

     

    1. There is a calendar table

    2. There should be a relationship from the Snapshotdate in the Data table to the Date column in your calendar table

    3. In the KPI visual, drag the date from the calendar table

    4. The slicer should be built from the Date column of the calendar table

     

    Hope this helps.