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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Cumulative total values showing wrong output.

Hi All,
I have created cumulative total measure but it didn’t work for me.
measure =

CALCULATE(

       DIVIDE(

        SUM(table[viewingDuration]),

       

        calculate(

        SUM(table[viewingDuration]),

    

           ALL(table[SearchnetSections])))

               *

                distinctCOUNT(table[RowId]),

    FILTER(

        ALL(table[SearchnetSections]),

        table[SearchnetSections] <= max(table[SearchnetSections])))

 

Yagevendra_0-1650363962540.png

 



Cumulative total should work on last column 2814.03 + 2501.35
but the output result is different than expected in weighted by viewing time column
as we can see 2nd values is showing the wrong output 8656.55

Need help to resolve this issue.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , In case you need sum then try like

 

CALCULATE(

Sumx(Values(SearchnetSections) ,calculate( DIVIDE(
SUM(table[viewingDuration]),
calculate(
SUM(table[viewingDuration]),
ALL(table[SearchnetSections])))
*
distinctCOUNT(table[RowId]) )),
FILTER(
ALL(table[SearchnetSections]),
table[SearchnetSections] <= max(table[SearchnetSections])))

 

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

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I have two suggestions for your formula.

 

First, there is actually no accumulation logic in your formula "CALCULATE( DIVIDE(a,b)*c, FILTER())", for accumulation, the most common formula is "CALCULATE(SUM(),FILTER())" or "SUMX(FILTER(),expression)".

 

Second, if you want to get the total value of [viewingDuration] in the whole table, it will not get the correct result by your formula "CALCULATE ( SUM ( table[viewingDuration] ), ALL ( table[SearchnetSections] )", because of the table filter in your formula, it should be "CALCULATE ( SUM ( table[viewingDuration] ), ALL ( table)".

 

Here's my solution, create a measure.

Measure = 
SUMX (
    FILTER (
        ALL ( 'table' ),
        'table'[SearchnetSections] <= MAX ( 'table'[SearchnetSections] )
    ),
    CALCULATE (
        DIVIDE (
            SUM ( 'table'[viewingDuration] ),
            CALCULATE ( SUM ( 'table'[viewingDuration] ), ALL ( 'table' ) )
        )
            * DISTINCTCOUNT ( 'table'[RowId] )
    )
)

I create a sample and get the correct result.

vkalyjmsft_0-1650967424909.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@Anonymous , In case you need sum then try like

 

CALCULATE(

Sumx(Values(SearchnetSections) ,calculate( DIVIDE(
SUM(table[viewingDuration]),
calculate(
SUM(table[viewingDuration]),
ALL(table[SearchnetSections])))
*
distinctCOUNT(table[RowId]) )),
FILTER(
ALL(table[SearchnetSections]),
table[SearchnetSections] <= max(table[SearchnetSections])))

 

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
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.