Forum Discussion
Unable to calculated difference using DAX
- Anonymous3 years ago
Hi Sekhar1 ,
According to your statement, I think the relationship between the column will cause this issue.I suggest you to create two unrelated slicer tables with [Year] and [Year and Week No] columns you need.
Data model:
Measures:
Sum of Total 1 = CALCULATE(SUM('Table'[Totals]),USERELATIONSHIP('DimDate 1'[Date],'Table'[Date]))Sum of Total 2 = CALCULATE(SUM('Table'[Totals]),USERELATIONSHIP('DimDate 2'[Date],'Table'[Date]))Difference = [Sum of Total 1] - [Sum of Total 2]Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sekhar1 , iof you want to use two date slicers, refer these ways
Power BI Abstract Thesis: How to use two Date/Period slicers
For Week on Week
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510