Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
How do I compare any 2 years data i.e. year 2018 data with 2021 data having multiple datasets on single page? I have got the dax query working for year over year comparison but not working for flexible year comparison. If there is a solution please reply .
Solved! Go to Solution.
Hi, @CecilMathew ;
You could create other two date table as slicer, then create a measure to calculate the difference.
1.create two table.
slicer1 = VALUES('Table'[date])
slicer1 = VALUES('Table'[date])
2.create a measure.
differ =
var _slicer1=CALCULATE(SUM([value]),FILTER(ALL('Table'),YEAR([date])=YEAR( MAX('slicer1'[date]))))
var _slicer2=CALCULATE(SUM([value]),FILTER(ALL('Table'),YEAR([date])=YEAR( MAX('slicer2'[date]))))
return DIVIDE(_slicer2-_slicer1,_slicer1)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @CecilMathew ;
You could create other two date table as slicer, then create a measure to calculate the difference.
1.create two table.
slicer1 = VALUES('Table'[date])
slicer1 = VALUES('Table'[date])
2.create a measure.
differ =
var _slicer1=CALCULATE(SUM([value]),FILTER(ALL('Table'),YEAR([date])=YEAR( MAX('slicer1'[date]))))
var _slicer2=CALCULATE(SUM([value]),FILTER(ALL('Table'),YEAR([date])=YEAR( MAX('slicer2'[date]))))
return DIVIDE(_slicer2-_slicer1,_slicer1)
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@CecilMathew , Check if these two slicers approaches can help you
How to use two Date/Period slicers :https://www.youtube.com/watch?v=WSeZr_-MiTg
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |