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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nikkirai
Frequent Visitor

Running Percentages DAX Power BI

Hi all,

 

I'm trying to get running percentages for this dummy dataset based on a real dataset:

 

MemberID, PortfolioID

1,1

1,2

1,3

1,4

1,5

1,6

1,7

1,8

1,9

1,10

2,1

2,2

2,3

 

I want to add another column [Running Percentages] to this dataset as below:

MemberID, PortfolioID, RunningPercentage

1,1, 10%

1,2, 20%

1,3, 30%

1,4, 40%

1,5, 50%

1,6, 60%

1,7, 70%

1,8, 80%

1,9, 90%

1,10, 100%

2,1, 33%

2,2, 66%

2,3, 100%

In SQL, there is the percentile_rank, but how do I do this in Power BI?

Thank you!

1 ACCEPTED SOLUTION
andhiii079845
Solution Sage
Solution Sage

Try this:
 
Measure =
VAR _group = CALCULATE(max('Table'[MemberID]))
VAR _max = CALCULATE(DISTINCTCOUNT ('Table'[PortfolioID]),FILTER(ALLSELECTED('Table'),'Table'[MemberID]=_group))
 RETURN RANKX(CALCULATETABLE('Table','Table'[MemberID],'Table'[PortfolioID],'Table'[MemberID]=_group),CALCULATE(sum('Table'[PortfolioID])),,ASC)/_max 
 
andhiii079845_0-1679342565783.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
andhiii079845
Solution Sage
Solution Sage

Try this:
 
Measure =
VAR _group = CALCULATE(max('Table'[MemberID]))
VAR _max = CALCULATE(DISTINCTCOUNT ('Table'[PortfolioID]),FILTER(ALLSELECTED('Table'),'Table'[MemberID]=_group))
 RETURN RANKX(CALCULATETABLE('Table','Table'[MemberID],'Table'[PortfolioID],'Table'[MemberID]=_group),CALCULATE(sum('Table'[PortfolioID])),,ASC)/_max 
 
andhiii079845_0-1679342565783.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It works perfectly. Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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