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! Request now

Reply
mjgenesis
Frequent Visitor

cumulative sum based on a percentile calculation

This seems extremely easy, but I can't for the life of me figure it out.  I have a table of values with a DAX calculated column containing an amount and I'm trying to get the cumulative sum of those amounts less than or equal to <= a Percentile.INC measure (called IQR3) already calculated for the group of records.  This cumulative sum total will change (as will the percentile) if filters/slicers are used on the data, ideally.  The two formulas I've tried below only give the full cumulative total, not the total of amounts less than or equal to the IQR3 value.:

 

CUMUL_SUM_HRC =
CALCULATE (
    SUM(Table1[Amount]),
    FILTER(ALL(Table1),Table1[Amount] <= [IQR3]))
 
and.... 
 
CUMUL_SUM_HRC = SUMX(FILTER(Table1,Table1[Amount] <= [IQR3]),Table1[Amount])
 
Any help is greatly appreciated. Not sure where I'm going wrong. Thanks in advance
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@mjgenesis Try:

CUMUL_SUM_HRC =
  VAR __IQR3 = [IQR3]
  VAR __Result = SUMX(FILTER('Table1', 'Table1'[Amount] <= __IRQ3), 'Table1'[Amount])
RETURN
  __Result

If that doesn't work, paste some sample data.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@mjgenesis Try:

CUMUL_SUM_HRC =
  VAR __IQR3 = [IQR3]
  VAR __Result = SUMX(FILTER('Table1', 'Table1'[Amount] <= __IRQ3), 'Table1'[Amount])
RETURN
  __Result

If that doesn't work, paste some sample data.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

This worked.  Thanks so much for the help.  If it isn't too much trouble could you sum up why the formulas I was trying weren't working?  I'm guessing the dynamic changing nature of the IQR and Amount variable requires a fixed use as a variable?  Really appreciate it.

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.