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.
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.
I try to do the same thing, but I cant. Could you help me?
My pbix is here:
https://drive.google.com/file/d/1c5DpEI4rsoPX8U8EBepHJ9gSsSmckLmg/view