This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello. I have a very typical data model with a Sales fact table and a Dates table. I have a measure that looks like this:
Hi @bvy ,
You need to pick up the last week that has data so you need to do somethig similar to the following:
SalesLastWeek =
VAR MAXWEEKYEAR =
MAXX (
TOPN (
1,
FILTER (
ALL ( Dates[WeeKNumYear] ),
Dates[WeeKNumYear] <= MAX ( Dates[WeeKNumYear] )
),
Dates[WeeKNumYear], DESC
),
Dates[WeeKNumYear]
)
RETURN
CALCULATE (
[Sales],
FILTER ( ALL ( Dates ), Dates[WeekNumYear] = MAXWEEKYEAR )
)
I added a WeenunmYear because if you only have week num on the change of year result will be incorrect.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCheck out the April 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 |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 35 | |
| 30 | |
| 23 | |
| 22 |