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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Cumulative Totals with filter

Hello,

 

I have a table with product sales data with a month column.

 

I created a measure to represent the percentage of the total. Now I need to make another column accumulating the percentage of the total (column PercentTotal). Remembering that I have the filter per month (single filtering), and the products are repeated in one month and others.

 

pbi1.png

pbi2.png

 

Follows PBIX file https://1drv.ms/u/s!Avwq0_QZmBwmgtUnB6iDHQ1f6KPM3A?e=P7ycSS 

 

Could anyone help with this?

With kind regards.

1 ACCEPTED SOLUTION

@Anonymous , Try like

divide( calculate(sum(sheet1[total]), filter(allselected(sheet1), sheet1[total] <= max(sheet1[total]))), calculate(sum(sheet1[total]), allselected(sheet1)))

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

View solution in original post

5 REPLIES 5
AlB
Community Champion
Community Champion

Hi @Anonymous 

PercentTotal V2 = 
VAR currentProduct_ = SELECTEDVALUE ( Sheet1[Product], MAX ( Sheet1[Product] ) )
RETURN
    DIVIDE (
        CALCULATE ( SUM ( Sheet1[Total] ), Sheet1[Product] <= currentProduct_ ),
        CALCULATE ( SUM ( Sheet1[Total] ), ALLSELECTED ( Sheet1 ) )
    )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Anonymous
Not applicable

@amitchandak, thanks for the answer.

 

I would like to have these accumulated values sorted by the total. It stayed this way.

 

pbi3.png

 

In my question I was not entirely clear about this earlier..

 

Regards.

@Anonymous , Try like

divide( calculate(sum(sheet1[total]), filter(allselected(sheet1), sheet1[total] <= max(sheet1[total]))), calculate(sum(sheet1[total]), allselected(sheet1)))

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
Anonymous
Not applicable

@amitchandak, It worked by changing the signal to greater.

 

sheet1[total] >= MAX(sheet1[total])

 

@AlB Thanks for the answer.

 

 
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

divide( calculate(sum(sheet1[total]), filter(allselected(sheet1), sheet1[product] <= max(sheet1[product]))), calculate(sum(sheet1[total]), allselected(sheet1)))

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.