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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
H_Kar
Regular Visitor

Ratio

Hey Guys ! 

I'm trying to display a metric showing a ration. For example assume we have fields such as Active - Innactive - Completed - Cancelled - Finished. 

 

my objective is to display finsihed/Active - Innactive - Completed - Cancelled. 

 

How can I do that on power bi desktop ?  
many thanks in advance ! 

5 REPLIES 5
H_Kar
Regular Visitor

Yes here is a screenshot of the error message when I put ratio1 under values along count of status.Screenshot 2024-05-14 132610.png

dk_dk
Super User
Super User

Hi @H_Kar ,

Assuming your data looks like this:

dk_dk_0-1715677973216.png

You can write the following measure to calculate the ratio:

 

Ratio = 

VAR finished = CALCULATE(COUNTROWS('Table'),'Table'[status]="Finished")
VAR other = CALCULATE(COUNTROWS('Table'),'Table'[status] IN {"Inactive","Cancelled","Active","Completed"})

RETURN
DIVIDE(finished,other,0)

 

 

Here I assumed that you want to calculate finished to all other statuses. If you want to calculate Active minus inactive minus completed minus calcelled, then you will just need to create multiple variables similar to the "finished" variable and then write the desired calculation in the return statement.

 

Let me know if you have any questions!




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

Proud to be a Super User!





H_Kar
Regular Visitor

Screenshot 2024-05-14 132610.pngHi @dk_dk 

First of all, really appreciate you helping out. 

I've new measure and inserted the code you wrote, now I have it on my data (on the far right side) as "ratio1". 

 

My objective is to visualise it now - on the value I have "count of the status". Where does "ratio 1" go. I've given it several attempts however I unfortunately failed. 

 

here is a screenshot of the error message when i try to put it under "values"

 

 

Hi @H_Kar 

Does the measure show a calculation if you just add it to a card visual on its own, without any other fields added to the Values section?




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

Proud to be a Super User!





Hi @H_Kar 

You can visualise the measure by adding it to a card visual (as seen on my screenshot), a table, or another chart in the values section. It would help if you can provide a screenshot to figure out what is not working. 🙂




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

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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