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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kangkopi15
Helper I
Helper I

Percentage of value

Dear experts,
I am quite new to DAX, I need a little advice. I have this table, and I need to make a percentage of the score.
The output would be
Score 1 = 14.28%
Score 2 = 42.86%

and so on..

 

NameScore
Anna1
Alan2
Tobi3
Sam2
Tonny2
Toffon4
Bram5
1 ACCEPTED SOLUTION
collinsg
Super User
Super User

Good day kangkopi15,

It looks like you want to find the percentage of scores which are 1, 2...5. If this is the case you can create a matrix visual, put "Score" in rows and use this measure for the values.

Percentage frequency of score =
VAR thisScore = SELECTEDVALUE(tbl[Score])
VAR countOfAllScores = CALCULATE(COUNTROWS('tbl'),REMOVEFILTERS('tbl'))
VAR countOfScore = CALCULATE(COUNTROWS('tbl'),REMOVEFILTERS('tbl'),'tbl'[Score]=thisScore)
RETURN DIVIDE(countOfScore, countOfAllScores)

Hope this helps

View solution in original post

7 REPLIES 7
collinsg
Super User
Super User

Good day kangkopi15,

It looks like you want to find the percentage of scores which are 1, 2...5. If this is the case you can create a matrix visual, put "Score" in rows and use this measure for the values.

Percentage frequency of score =
VAR thisScore = SELECTEDVALUE(tbl[Score])
VAR countOfAllScores = CALCULATE(COUNTROWS('tbl'),REMOVEFILTERS('tbl'))
VAR countOfScore = CALCULATE(COUNTROWS('tbl'),REMOVEFILTERS('tbl'),'tbl'[Score]=thisScore)
RETURN DIVIDE(countOfScore, countOfAllScores)

Hope this helps

I got syntax error

kangkopi15

  1. Did you replace "tbl" with the name of your table?
  2. Is your "Score" column a number type?

The syntax is correct and gives the answers to the problem.

collinsg_0-1705388002951.png

Hope this helps

hi collin, my bad the syntax is correct, i didn't change the column name, however how can I change that to percentage?

Good day kangkopi15,

If you are working in Power BI Desktop there are several ways of presenting a measure as a percentage. The most straightfoward is to use the format drop-down on the modelling ribbon. For example, I created a simple measure for demonstration purposes, Percent = 1/3, then formatted it as "Percentage" with 2 decimal places.

collinsg_0-1705564819574.png

the procedure is similar if working in Excel,

collinsg_1-1705565007664.png

Hope this helps

 

 

zenisekd
Super User
Super User

Could you explain better how do you want to calculate it? Your description makes very little sense. 
is 1 = 14,28%
so 3 = 3*14,28%?

Or do you want to calculate a % of a grand total?

 

I am looking for the score percentage..
score 1, there is only one person put score 1, so from the total people who participated (7) the ratio or percentage of score 1 is 1/7 which would be around 14,28% 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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