Forum Discussion
Difference between values of two different days
Hi everyone,
I would like to subtract the values of these two dates but I'm having a hard time doing it. I've tried the below formula but it doesn't work.
I tried
Could you kindly assist me?
Image shown below where i need an extra column next to the dates showing the value difference. Also attached the pbix file.
https://drive.google.com/file/d/1mY3Sh23MGMPULASau0uYKayL4OUwR10i/view?usp=drive_link
Hi madlfc87 -Instead of filtering on specific dates within the SUMX function, you can use measures that directly filter the values based on the selected date.
Current Total1 =CALCULATE(SUM('Cash_all locations'[Balance USD]),'Cash_all locations'[Date] = DATE(2024, 8, 31))Previous Total1 =CALCULATE(SUM('Cash_all locations'[Balance USD]),'Cash_all locations'[Date] = DATE(2024, 8, 15))Difference = [Current Total1] - [Previous Total1]Check the attached pbix file FYR.
2 Replies
- rajendraongole1
Super User
Hi madlfc87 -Instead of filtering on specific dates within the SUMX function, you can use measures that directly filter the values based on the selected date.
Current Total1 =CALCULATE(SUM('Cash_all locations'[Balance USD]),'Cash_all locations'[Date] = DATE(2024, 8, 31))Previous Total1 =CALCULATE(SUM('Cash_all locations'[Balance USD]),'Cash_all locations'[Date] = DATE(2024, 8, 15))Difference = [Current Total1] - [Previous Total1]Check the attached pbix file FYR.
- madlfc87
Helper I
Thank you for your help!