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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Metric for sum based off max date in the week # (time) slicer.

Hi, 

 

I'm trying to get the sum of my inventory based on the maximum  week # from my slicer. 

For example, in the below image: 

  • The week #'s range is 34 to 37  
  • My Chain + Delivery KPI is $57,258,675
    • This is the sum of all 4 weeks

The Measure I'm trying to make can be seen in the tool bar below as well. 

 

The metric should report the inventory for only the 37th week, but I'm having a challenge with this one. 

slacey7070_2-1635017488945.png

 

 

Thank you for any help. 

 

 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Inventory=
VAR maxweek = MAX( Calendar[week] )

RETURN
CALCULATE(
SUM( Sales[Amount] ),
Calendar[week] = maxweek
)

View solution in original post

2 REPLIES 2
speedramps
Super User
Super User

Inventory=
VAR maxweek = MAX( Calendar[week] )

RETURN
CALCULATE(
SUM( Sales[Amount] ),
Calendar[week] = maxweek
)

Anonymous
Not applicable

Amazing, thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.