Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rpinxt
Solution Sage
Solution Sage

Placeholder issue Calculate formula

I have a measure in which I would to find the quantity for the latest week.

Wanted to do it like this but placeholder error:

rpinxt_0-1682427692378.png

 

My MaxWeek :

MaxWeek = WEEKNUM(MAX('Backorder Details'[Doc. Entry]))
 
I also made MaxWeek -1
As you see it works:
rpinxt_2-1682427779631.png

 

But now I want the Qty belonging to MaxWeek and Maxweek -1

Because I want to see the change between the last week and the week before.

 

What am I doing wrong? Or is there a better way?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

BO Current =
VAR MaxWeek = [Max week]
RETURN
    CALCULATE ( [BO Tot Qty], 'Dim date'[Week nr (ISO)] = MaxWeek )

If your data spans multiple years you may also want to filter on the year.

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Try

BO Current =
VAR MaxWeek = [Max week]
RETURN
    CALCULATE ( [BO Tot Qty], 'Dim date'[Week nr (ISO)] = MaxWeek )

If your data spans multiple years you may also want to filter on the year.

Superb! @johnt75 

Works like a charm 😄 (also indeed put in a year filter)

 

So guess you cannot directly reference the measure but putting it in a variable solves this 🙂

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors