This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello,
I have a simple clustered column chart, which is showing month to month comparison between current year and last year.
User can change the Year using slicer, and the report will show always selected year vs last year.
However, I would like to modify it and make both years selectable. So you can have on one chart 2020 vs 2018 or 2019 vs 2016 etc.
Can this be done in PowerBI? Maybe you have some examples?
Solved! Go to Solution.
hi @Anonymous
For your case, you need to use DATEADD to custom them,
and this will lead to multiple measure, now you could combine them into one measure and use a slicer to switch them, see more details as below blog:
Regards,
Lin
Hi
I have this same problem with thread creator, I want to compare 2 years, but I want to select the years.
The link that has give as solution, I don't understand what does it mean. Can anyone help explain to me?
Will be very appreciate the help!
hi @Anonymous
For your case, you need to use DATEADD to custom them,
and this will lead to multiple measure, now you could combine them into one measure and use a slicer to switch them, see more details as below blog:
Regards,
Lin
@v-lili6-msft, @amitchandak isn't there a solution to make this more dynamic friendly and maintainable. What if a user wants to compare with 8 years ago? Each year comparison you need to put in the measure.
@Anonymous , One way is have trailing /last year meausre like these example
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
2nd Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
3rd Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-3,Year),"12/31"))
4th Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-4,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
2 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-2,Year))
3 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-2,Year))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 26 | |
| 25 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 41 | |
| 40 | |
| 21 | |
| 20 |