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

Create a Measure which Returns a Certain Value from a Cumulative Measure

Hi! I wanted to create a measure which will return a specific value which is computed using a cumulative total. For example, I only want to get the Cumulative Target for Week 5 which is 2064. Note again that Cumulative Target is a calculated measure and not a calculated column. Is there a way to create a measure such as this?

 

Thank you!Cumulative Target.JPG

 

2 ACCEPTED SOLUTIONS
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

This worked for me and I have attached a basic PBIX file.

 

Measure = CALCULATE([Cumulative Target],'Table1'[Week]="Week 5")

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Anonymous
Not applicable

 

Figured it out. I just have to use <= instead of an equal sign for the Week in Measure. Thanks a lot @Phil_Seamark Smiley Very Happy

 

 

Measure = CALCULATE([Cumulative Target],'Table1'[Week] <= "Week 5")

 

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
Employee

Hi @Anonymous

 

This worked for me and I have attached a basic PBIX file.

 

Measure = CALCULATE([Cumulative Target],'Table1'[Week]="Week 5")

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

 

Figured it out. I just have to use <= instead of an equal sign for the Week in Measure. Thanks a lot @Phil_Seamark Smiley Very Happy

 

 

Measure = CALCULATE([Cumulative Target],'Table1'[Week] <= "Week 5")

 

Anonymous
Not applicable

Hi @Phil_Seamark,

 

Thanks for the fast response Smiley Happy

 

But I'm still having trouble. Using the formula, the measure returns the Target not the Cumulative Target.

 

Here's my formula for the Cumulative Target:

Cumulative Target= 
    CALCULATE( SUM( 'Table'[Target] ),
               FILTER( ALLSELECTED( 'Table' ),
                       'Table'[Week Number] <= MAX( 'Table'[Week Number] )
               ))

I have another column in my table which is the Week Number.

 

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.