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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jonbox
Helper II
Helper II

Represent score as a percentage

Hello there,

 

I'm looking for two things with my powerBI, firstly to count a total of each measure per department and show as a percentage out of 100 e.g.:

For department1, looking at the measure "IT", the score is represented by 1's and 0's. I'd like a measure to count the number of measures we're looking at e.g. for IT in department1, we're looking at an over all potential score of 3. 

 

SO for department 1, the score is 2/3, so should be represented as 66%.

for department2 IT, the score it 1/2 so should be represented at 50%

Department 3 is 1/1 so 100% etc...

 

the score should be split per measure, meaning department1 score for IT is 66%, for finance it is 100%

department2 IT is 50%, finance is 0% and so on...

 

Any help would be greatly appreciated!! 

 

DepartmentMeasureScore
Department1IT0
Department1IT1
Department1IT1
Department2IT0
Department2IT1
Department3IT1
Department1Finance1
Department1Finance1
Department2Finance0
Department2Finance0
Department3Finance1
Department3Finance0

 

 

The reason i'm asking for this is so that i can show my scores for each department in a bar graph:

The graph can be filtered to each "measure" and the score is adjusted. currently the score just counts the number of 1's rather than showing as an over all percentage.

 

jonbox_0-1638461271989.png

 

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @jonbox 

Try to create measures like this:

_count = 
CALCULATE(COUNT('Table'[Measure]),FILTER(ALLSELECTED('Table'),'Table'[Department]=MAX('Table'[Department])))
_percentage = 
var _score=CALCULATE(SUM('Table'[Score]),FILTER(ALLSELECTED('Table'),'Table'[Department]=MAX('Table'[Department])))
return DIVIDE(_score,[_count])

 

Result:

vangzhengmsft_1-1638766626678.png

 

Please refer to the attachment below for details. Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

View solution in original post

1 REPLY 1
v-angzheng-msft
Community Support
Community Support

Hi, @jonbox 

Try to create measures like this:

_count = 
CALCULATE(COUNT('Table'[Measure]),FILTER(ALLSELECTED('Table'),'Table'[Department]=MAX('Table'[Department])))
_percentage = 
var _score=CALCULATE(SUM('Table'[Score]),FILTER(ALLSELECTED('Table'),'Table'[Department]=MAX('Table'[Department])))
return DIVIDE(_score,[_count])

 

Result:

vangzhengmsft_1-1638766626678.png

 

Please refer to the attachment below for details. Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.