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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
rusgesig
Helper IV
Helper IV

Stop a Running Total at maximum value while showing less than and equal to values

I've been struggling with this particular item since day one, and every time I think I've made progress I hit the same wall.

 

Basically, I'm trying to show uptake over time, instead of using a date table, I have a series from 0-100 which represents months after activation.

When using the measure below:

Measure =
CALCULATE(
    SUM('Uptake'[Uptake]),
    FILTER(
        ALLSELECTED('MonthSeries'[MonthSeries]),
        ISONORAFTER('MonthSeries'[MonthSeries], MAX(Uptake[Months]), DESC)
    )
)
 

I get the following problem: For months in which there was no uptake, I want it to show the maximum up to that point, instead it shows a blank if nothing fell within that particular month.

 

However when I use this measure:

Measure =
CALCULATE(
    SUM('Uptake'[Uptake]),
    FILTER(
        ALLSELECTED('MonthSeries'[MonthSeries]),
        ISONORAFTER('MonthSeries'[MonthSeries], MAX(MonthSeries'[MonthSeries]), DESC)
    )
)
 
I get the problem of the values not stopping at their maximum, they just continue at the maximum value for the entire series, but I would like them to show blanks after the maximum value.

 

 

Is there anyway to get the best of both worlds? Show the value less than or equal to the current month, unless it's greater than the maximum, in which case leave it blank.

 

 

5 REPLIES 5
amitchandak
Super User
Super User

@rusgesig , Your second measure should stop

 

Measure =
CALCULATE(
SUM('Uptake'[Uptake]),
FILTER(
ALLSELECTED('MonthSeries'[MonthSeries]),
'MonthSeries'[MonthSeries]<= MAX('MonthSeries'[MonthSeries])
)
)

 

Or try Like

 

Measure =
var _maxx(ALLSELECTED('MonthSeries'),'MonthSeries'[MonthSeries])
return

CALCULATE(
SUM('Uptake'[Uptake]),
FILTER(
ALLSELECTED('MonthSeries'[MonthSeries]),
'MonthSeries'[MonthSeries]<= MAX('MonthSeries'[MonthSeries])
&& MonthSeries'[MonthSeries] <=_maxx
)
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

So is this a bug in Power BI?

Hi amitchandak, thanks for your reply.

 

Unfortunately your first measure returns the same results as my second measure (doesn't stop at month 25 in this case).

The second measure is not accepted due to a syntax error.

rusgesig_1-1600332502067.png

 

 

 

Bump

rusgesig
Helper IV
Helper IV

For some reason it keeps removing the screenshots I upload.

1st Measure:

Screenshot.png

2nd Measure :

Screenshot2.png

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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