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
nb123nb
Frequent Visitor

Cumulative measure without date

I need help with creating a couple of cumulative measures 🙂

 

I have the following data in a table

Capture.PNG

 

 

 

 

 

 

 

 

I want to create a cumulative measure for the TotalCount and TotalRun but ONLY for those that have the week number in the title...so it should look something like this:

Capture2.PNG

 

 

 

 

What would be the correct measure to use?

1 ACCEPTED SOLUTION
nb123nb
Frequent Visitor

Figured it out - the solution is:

1) Add an IF statement for the week number

WeekRank = IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 1", 1, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 2", 2, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 3", 3, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 4", 4, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 5", 5, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 6", 6, 0))))))
 

2) Create 2 x measures - example being:

RunCumulative =

CALCULATE(
    SUM('Rollup'[RunCount]),
    FILTER(ALLSELECTED('Rollup'),
    'Rollup'[WeekRank] <= MAX('Rollup'[WeekRank])
    )
)
 
Capture3.PNG

View solution in original post

5 REPLIES 5
nb123nb
Frequent Visitor

Figured it out - the solution is:

1) Add an IF statement for the week number

WeekRank = IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 1", 1, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 2", 2, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 3", 3, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 4", 4, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 5", 5, IF('Test Plan Rollup2'[TestSuite.TitleLevel2] = "Week 6", 6, 0))))))
 

2) Create 2 x measures - example being:

RunCumulative =

CALCULATE(
    SUM('Rollup'[RunCount]),
    FILTER(ALLSELECTED('Rollup'),
    'Rollup'[WeekRank] <= MAX('Rollup'[WeekRank])
    )
)
 
Capture3.PNG
Arul
Super User
Super User

@nb123nb ,
Have tried the below formulas in your measures?

CountCumulative = 
CALCULATE(
    SUM('Sample'[Totalcount]),
    'Sample'[Title] <=MAX('Sample'[Title]))
CumulativeRun = 
CALCULATE(
    SUM('Sample'[TotalRun]),
    'Sample'[Title] <=MAX('Sample'[Title]))

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


nb123nb
Frequent Visitor

Sorry that doesn't seem to work for cumulative:

Capture3.PNG

@nb123nb ,

Can you share the modified formula you have used?

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


nb123nb
Frequent Visitor

Yes of course:

CountCumulative =
CALCULATE(
    SUM('Rollup'[TotalCount]),
    'Rollup'[Title] <=MAX('Rollup'[Title]))

RunCumulative =
CALCULATE(
    SUM('Rollup'[RunCount]),
    'Rollup'[Title] <=MAX('Rollup'[Title]))
 

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.