Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi There ,
Hope you doing well,
I want to create an measure showing Year to Year Total sales in column chart however i want that calculation to pick automatically upcoming year data also e.g 2017,2018,2019,2020 and so on...
I am using this Dax:
Sales LY=calculate(Total[Sales],dateadd(dates(date),-1,Year))
but by this process i have to make each year measure ...So is there any formula where i can use single measure and all the years data will appear in one go
I really appreicate if anyone can help me in this.
Regards,
Ashish
Solved! Go to Solution.
Hi @Ashish_kumar12 ,
First I created a calendar table.
Table =
CALENDAR(
MIN(Sheet2[date]),
MAX(Sheet2[date])
)
Then I created table relationship.
Then I used your measure formula.
Sales LY =
CALCULATE(
SUM(Sheet2[Value]),
DATEADD( 'Table'[Date], -1, YEAR )
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Ashish_kumar12 ,
First I created a calendar table.
Table =
CALENDAR(
MIN(Sheet2[date]),
MAX(Sheet2[date])
)
Then I created table relationship.
Then I used your measure formula.
Sales LY =
CALCULATE(
SUM(Sheet2[Value]),
DATEADD( 'Table'[Date], -1, YEAR )
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Ashish_kumar12 ,
Try this.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Lionel,
Thank you for your reply and the example which you showed.
Unfortunatley i am not able to open your pbix file, could you please share me Dax here if possible ?
Regards,
Ashish
Look at the "Quick Measures" option in Power BI, it has templates for such a scenario.
Make sure that you have a proper calendar table, too.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |