Forum Discussion

MrKrukauskas's avatar
MrKrukauskas
Helper I
6 years ago
Solved

Calculate difference between two filtered measures

Hi Power BI Community, hope you all staying safe! My first question here, so please don't judge me 😄 I have been trying to calculate revenue difference, for the same Division, between two differ...
  • jdbuchanan71's avatar
    6 years ago

    MrKrukauskas 

    I think what you will need is 2 date lists, one linked to each field [Data Load Date] and [Historical Date]

    You use the dates from those 2 tables in the slicers and write the measures so the [Data Load Amonut] ignores the filters from the 'Historical Dates' table and vice versa.

    Total Amount = SUM ('Table'[Amount] )
    Data Load Amonut = CALCULATE( [Total Amount],ALL('Historical Dates') )
    Historical Amount = CALCULATE( [Total Amount],ALL('Data Load Dates') )
    Difference = [Data Load Amonut] - [Historical Amount]

    On both of the date slicers I also added a filter where [Total Amount] is not blank so that only dates with an amount would show in the list.

    I have attached my sample file for you to look at so you can see how I made the two date tables.