Forum Discussion
sraj
Responsive Resident
5 years agoYear & month comparision
Hi everyone, Is there anyway to show the difference between years? Both Years/Months are in the same table, can someone please advise?
- 5 years ago
Hi sraj,
You can try measure as:
Measure = IF( HASONEVALUE('Table'[Date]), MAX('Table'[Sales]), CALCULATE( MAX('Table'[Sales]), FILTER( 'Table', YEAR('Table'[Date])=2021) )- CALCULATE( MAX('Table'[Sales]), FILTER( 'Table', YEAR('Table'[Date])=2020) ) )Here is the output:
The pbix is attached.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Ashish_Mathur
Super User
5 years agoHi,
In the Row labels, show only the Month (not YearMonth). Furthermore, you should have a Calendar Table with a relationship from the Date column of your Data Table to the Date column of your Calendar Table. In your Calendar Table, write calculated column formulas to extract Year and YearMonth. To your visual, drag Year and YearMonth from the Calendar Table.