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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
LotteLaugesen
Helper V
Helper V

How to calculate accumulated percentage

Hi 

 

How do you calculate accumulated percentage when time is not involved?
It should accumulate per Logon name. 

LotteLaugesen_0-1708419181392.png

Best regards
Lotte

4 REPLIES 4
v-weiyan1-msft
Community Support
Community Support

Hi @LotteLaugesen ,

 

@Dangar332 nice method! Thank you, for your quick response and the solution provided.
I am not sure how your semantic model looks like, but based on the sample and description you provided, I tried to create some dummy data.

vweiyan1msft_0-1708485009713.png

Please try code as below.

% of Total = 
VAR Total_View = COUNTROWS(ALL('Table'))
RETURN
[Report Views] / Total_View
Accum % = 
VAR Total_View = COUNTROWS(ALL('Table'))
RETURN
CALCULATE (
    DIVIDE ( SUMX(VALUES('Table'[Login name]),[Report Views]), Total_View ),
    FILTER (
        ALL ( 'Table'[Login name] ),
        'Table'[Login name] <= MAX ( 'Table'[Login name] )
    )
)

Result is as below.

vweiyan1msft_1-1708485068084.png

For further details,please find attachment.


Best Regards,
Yulia Yan


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

Thank you, @v-weiyan1-msft 

Your calculation is not giving me the correct result, maybe it's because the visual is order by Report views and not Logon name.
But this calulation (almost) works:

Accum % Logons = 
IF( ISINSCOPE( FT_PBI_ActivityLog[Logon name] ),
VAR CurrentRank = 
    [Report View Rank By Logon]
VAR RankAndViews =
    ADDCOLUMNS(
        ALLSELECTED(FT_PBI_ActivityLog[Logon name]),
        "@Ranking", [Report View Rank By Logon],
        "@Views", [Report Views]
    )
VAR MoreViews =
    FILTER(RankAndViews,
        [@Ranking] <= CurrentRank
    )
VAR Result =
    SUMX(MoreViews, [@Views])
RETURN DIVIDE(Result,CALCULATE(COUNT(FT_PBI_ActivityLog[ReportName]),REMOVEFILTERS(FT_PBI_ActivityLog[Logon name])))    
)

Except when 2 or more Logon name have the same no of Report views

LotteLaugesen_0-1708505052245.png

 

BR

Lotte

Dangar332
Resident Rockstar
Resident Rockstar

Hi, @LotteLaugesen 

if time is not present for comparing purpose then use below method it might work
make a new column

 

Column 2 = 
var a = sumx(FILTER(ALL('Table'),'Table'[view]>EARLIER('Table'[view])),'Table'[view])
var b = 'Table'[view]+a
var c = SUM('Table'[view])
return
b/c

 

 

Dangar332_0-1708430318880.png

 

and don't forgot to change  column type to percantage 

Hi @Dangar332 

Thanks for your answer, but 'Report Views' is a measure not a columnn in the table.
The table is not summarized, but has 1 record per view.

Report Views = COUNT(FT_PBI_ActivityLog[ReportName])

Do you have any other ideas?

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.