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
Anonymous
Not applicable

How to get the other part of a percentage in Power BI DAX

Hi - I have a simple calculation to find a percentage of unavailable products

 

DIVIDE(COUNTA('Sales'[Out of Stock]), COUNTA('Sales'[Products]))
 
Its giving me the percentage of products Out of Stock from all products
 
What can I add to the DAX to get it to show me the percentage of Products that are in stock?
 
ie, if its showing 22% unavailable I want it to show 78% available

Thanks in advance!
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

If you have X% and you want the remainder that totals to 100%, simply take 100% - X%.

 

1 - DIVIDE ( COUNTA ( 'Sales'[Out of Stock] ), COUNTA ( 'Sales'[Products] ) )

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

If you have X% and you want the remainder that totals to 100%, simply take 100% - X%.

 

1 - DIVIDE ( COUNTA ( 'Sales'[Out of Stock] ), COUNTA ( 'Sales'[Products] ) )
Anonymous
Not applicable

thanks - how do I write that into the expression? I cant figure that part out 😄

Did you miss the "1 - " part in the code I wrote?

Anonymous
Not applicable

Ah yes - sorry I did, I read that as the first code line 😄 Thanks, I was making it way more complicated that it needed to be 

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.