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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
525380
Frequent Visitor

Help! I need a measure that prints out 1 and increments +1 each time the team# summed hits the max

I need a measure that prints out 1 and increments +1 each time the team# summed hits the max. The measure i have below is giving me a strange result. see pic below.

 

 

Period = 
VAR Priority = SELECTEDVALUE('Epic'[Priority])
RETURN
    IF (
        ISBLANK(Priority),
        BLANK(),
VAR CumulativeTotal =
CALCULATE (
    SUM ( 'Epic'[Teams/PI Avg] ),
    REMOVEFILTERS ( 'Epic' ),
    'Epic'[Priority] <= SELECTEDVALUE ( 'Epic'[Priority] )
)
VAR Divisor = SELECTEDVALUE ( 'Epic'[Portfolio Supply] )
VAR Suffix = IF ( Divisor <> 0, QUOTIENT ( CumulativeTotal - 1, Divisor ) )
VAR Result =  VALUE ( Suffix + 1)

RETURN IF ( ISINSCOPE ( 'Epic'[Priority] ), Result ) -- gets rid of the nonsensical Total value
    )

 

 

525380_0-1684411181640.png

here is the PBIX: Test Max PBIX 

2 REPLIES 2
ppm1
Solution Sage
Solution Sage

Please clarify what you mean by "hits the max". Is it when the next number is lower? If so, why doesn't your final value of 0 get a result of PI 4?

 

Pat

Microsoft Employee
525380
Frequent Visitor

Thank you for responding. The portfolio supply column is the max value.

The Teams/PI Avg is summed till it hits the portfolio supply, and then resets the running total again. I need the Period to return the text "PI 1". Once the running total, resets it should return "PI 2" and so on. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.