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
m__m
Frequent Visitor

Need help with DAX

I need to display No% and Yes%.

 

m__m_2-1678766614472.png

 

I have market and sales count. I need to display No% and Yes%.

No% =( Sales Count/Grand Total ) * 100 - Ex : (122/370)*100 = 33%

Yes% = 100 - No% - Ex : 100-33 = 67%

 

Can you please help me with the DAX to get the No% and Yes%?

I have to finally visualize the Yes% in a bar chart.

3 REPLIES 3
johnt75
Super User
Super User

You can create a measure like

No % =
IF (
    ISINSCOPE ( 'Table'[Market] ),
    VAR CurrentValue =
        SUM ( 'Table'[Sales count] )
    VAR TotalValue =
        CALCULATE ( SUM ( 'Table'[Sales count] ), ALLSELECTED ( 'Table'[Market] ) )
    RETURN
        DIVIDE ( CurrentValue, TotalValue )
)

and then 

Yes % = 1 - [No %]

Format both measures as percentages

m__m
Frequent Visitor

Thank you.. this worked! 

Another issue - If i have a 'Market' slicer on the report page, and I select a market .. for example - "Central".

In this case, I just want to show the 'Central' data but with the same yes% of 67%. How to achieve that? 

To simplify - the calculation % is still based on the complete data which market slicer should not affect but I am able to see just the data for cental and not others.

For that you could replace ALLSELECTED('Table'[Market]) with ALL('Table'[Market])

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.