Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I need to display No% and Yes%.
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.
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
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])
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
8 | |
6 |