Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I am struggling to wrap my head around producing gauges based on data that is either boolean or categorical.
I have data over a month, with a yes or no answer - currently 1 for yes 0 for no.
I want to see the % of "yes" answers over the month on one guage and then the % of "yes" answers for each week of the month on the other guages.
This should be simple enough but I can't seem to get the measures down. If I could add a slicer to show the the percentage of a selection, that would be great too, ie make a selection of a few dates and see the resulting "yes" percentage.
Thanks in advance.
Solved! Go to Solution.
Hi @fyrworx,
According to your description, I have made a sample for your reference.
I assume you have a table called "MyTestTable" like below.
Then you should be able to use the formula below to create a measure called "% of yes" and show it on the report according to the selection of the Slicer.
% of yes = CALCULATE ( COUNTROWS ( MyTestTable ), MyTestTable[Answer] = 1 ) / CALCULATE ( COUNTROWS ( MyTestTable ) )
Regards
Hi @fyrworx,
According to your description, I have made a sample for your reference.
I assume you have a table called "MyTestTable" like below.
Then you should be able to use the formula below to create a measure called "% of yes" and show it on the report according to the selection of the Slicer.
% of yes = CALCULATE ( COUNTROWS ( MyTestTable ), MyTestTable[Answer] = 1 ) / CALCULATE ( COUNTROWS ( MyTestTable ) )
Regards
Thank you!
I am very new to DAX, so its just figuring out the correct code for what I need.
This is exactly what I need, thanks for the response.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
84 | |
63 | |
63 | |
49 | |
45 |