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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rpinxt
Impactful Individual
Impactful Individual

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.

rpinxt
Impactful Individual
Impactful Individual

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.