Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
madlfc87
Helper I
Helper I

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 

 

Previous Total = SUMX(FILTER('Cash_all locations','Cash_all locations'[Date]=15/08/2024),'Cash_all locations'[Balance USD])
 
Current Total = SUMX(FILTER('Cash_all locations','Cash_all locations'[Date]=31/08/2024),'Cash_all locations'[Balance USD])
 
to then subtract them but they come up with no data. Am I doing something wrong?

 

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.


madlfc87_0-1726494494453.png

https://drive.google.com/file/d/1mY3Sh23MGMPULASau0uYKayL4OUwR10i/view?usp=drive_link

1 ACCEPTED SOLUTION
rajendraongole1
Super User
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]
 

rajendraongole1_0-1726495642677.png

 

Check the attached pbix file FYR.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
madlfc87
Helper I
Helper I

Thank you for your help!

rajendraongole1
Super User
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]
 

rajendraongole1_0-1726495642677.png

 

Check the attached pbix file FYR.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.