Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
i have a data for which we need to calculate increase/decrease from the previous month and previous days.
its a single table and the data is also available in single table.
Is there any DAX formula to calculate the value difference between two specific date coulmn wise
for ex - there are 5 coulms for dates and we have to find the value difference between the two date coulms at a time.
Solved! Go to Solution.
Hi @sue7579 ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create measures.
2021-10-31-2021-5-31- =
var _1031=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,10,31)))
var _0531=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,5,31)))
return _1031-_05312021-10-31-2021-6-30- =
var _1031=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,10,31)))
var _0630=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,6,30)))
return _1031-_06302021-10-31-2021-8-31- =
var _1031=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,10,31)))
var _0831=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,8,31)))
return _1031-_0831
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sue7579 ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create measures.
2021-10-31-2021-5-31- =
var _1031=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,10,31)))
var _0531=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,5,31)))
return _1031-_05312021-10-31-2021-6-30- =
var _1031=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,10,31)))
var _0630=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,6,30)))
return _1031-_06302021-10-31-2021-8-31- =
var _1031=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,10,31)))
var _0831=CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[type]=MAX('Table'[type]) && 'Table'[date]=DATE(2021,8,31)))
return _1031-_0831
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 137 | |
| 102 | |
| 71 | |
| 67 | |
| 65 |