Forum Discussion
Calculate difference between two filtered measures
- 6 years ago
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.
MrKrukauskas , depending on how you want to choose the date you need on one or two date table.
Like if you need the same date range then you have join with one date table. One active and one inactive join. And use relation to activate join.
In case you need a different date, You need to two date dimension. And in your formula, you need to all for the other date. Or you can use one of the date tables as disconnected and try .
Refer to this example. this done for one date. But you have to do for two dates
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601