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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Binway
Helper II
Helper II

calculate percentage values from counts

Hi,

I haved some very simple data that I want to group and count values against the total count expressed as a persnetage in a Card.

A sample data looks like this:

IdTraffic Light Indicator
1Green
2Green
3Red

 

After a bit of research on here I got the idea for some code that comes close.

Overall Traffic Light Percent = DIVIDE (

           COUNT('Table'[Id]),

           CALCULATE(COUNT('Table'[Id]),ALLSELECTED())  

)

Which produces this result in a table.

Overall Traffic LightOverall Traffic Light Percent
Green0.67
Red0.33

 

But I can't see how to turn this into a percentage value and display in a card so you see 67%, perhaps when the Card is visually filtered on Green or Red.

 

Thanks Binway

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Binway,

 

You can format the measure rather than the visuals. The Card visual can only show up one value. So you need a Slicer to filter the colors.

 

calculate percentage values from counts .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
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-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Binway,

 

You can format the measure rather than the visuals. The Card visual can only show up one value. So you need a Slicer to filter the colors.

 

calculate percentage values from counts .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.