Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
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êsIf you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 38 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 34 | |
| 33 | |
| 30 |