Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 72 | |
| 39 | |
| 35 | |
| 23 |