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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
JeremyJvR
New Member

Cumulative values and fill between values

Hi All,

 

I need some help with a measure to cumulate values, cut it off at the maximum "Index" value, but still keep fill the values between "Index" values that don't have values.

 

Basically my table look as follows.

JeremyJvR_0-1649780559518.png

I want the "Blue" lines to fill with the previous value and the "Red" lines to stay blank.

 

My current Measure looks like this.

 

IF(FIRSTNONBLANK(MasterValues[Index], MasterValues[Index]) <= max(Pricelist_table[Sort]),

CALCULATE(
    COUNTA('Pricelist_table'[Stock No]),
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('MasterValues', 'MasterValues'[Index], 'MasterValues'[Category]),
            ALLSELECTED('MasterValues')
        ),
        ISONORAFTER(
            'MasterValues'[Index], MAX('MasterValues'[Index]), DESC
        
    )
)), BLANK())
 
Context - "Sort" = Lookupvalue of the "Index" column in MasterValues
 
Thanks in advanced
 
6 REPLIES 6
amitchandak
Super User
Super User

@JeremyJvR , try like


CALCULATE(
COUNTA('Pricelist_table'[Stock No]), filter( allselected('MasterValues'),'MasterValues'[Index]<= MAX('MasterValues'[Index])))

 

or

 

IF(FIRSTNONBLANK(MasterValues[Index], MasterValues[Index]) <= max(Pricelist_table[Sort]),
CALCULATE(
COUNTA('Pricelist_table'[Stock No]),
FILTER(
CALCULATETABLE(
SUMMARIZE(allselected('MasterValues'), 'MasterValues'[Index], 'MasterValues'[Category]),
ALLSELECTED('MasterValues')
),
ISONORAFTER(
'MasterValues'[Index], MAX('MasterValues'[Index]), DESC

)
)), BLANK())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the reply.

 

It almost works, but not yet.

 

JeremyJvR_0-1649847739777.png

I need it to stop as soon as it hits the maximum, in this case 840.

 

The issue is that I want to plot this on a line graph against different stock units. It just looks ugly on the graph when those gaps shows

 

JeremyJvR_1-1649847890164.png

 

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

The amitchandak_2 seems just fine to me.  What is the problem?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

 

The issue are the gaps between point where no data is populated. Ideally I would like those gaps filled with a flat line, but not continuing beyond the last point of data.

 

JeremyJvR_0-1649931580809.png

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors