Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hello,
I am a pretty new user to PowerBI. I would like to set up a comined graph. Sales per week comparing current with previous year by week. This is no problem. But I would like to add to lines with the cumulated sales per week for the current and the previous year.
I have tried setting up a new measure using a DAX expression I found in another post:
Measure =
CALCULATE( SUM(Sales[SalesValue), FILTER(ALL(Calendar), Calendar[WeekNumber] <= SELECTEDVALUE(Calendar[WeekNumber]) ) )
I guess I have to set up one measure per year and add to the formula a filter for the year? Am I on the right track and how would I modify the formula to get the desired result?
Thanks,
Bastian
Solved! Go to Solution.
@Basti76 , Try like with date table or an independent Year/week table joined to your table
YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Week] <= Max('Date'[Week]) ))
LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Week] <= Max('Date'[Week])))
@Basti76 , Try like with date table or an independent Year/week table joined to your table
YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Week] <= Max('Date'[Week]) ))
LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Week] <= Max('Date'[Week])))
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 18 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 38 | |
| 31 | |
| 26 |