- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to count number of yes/no from two separate columns in a table for pie chart?
Workplace | Does workplace have a water cooler? | Does the workplace have a microwave? |
A | Yes | No |
B | ||
C | Yes | Yes |
D | No | Yes |
E | ||
F | No | No |
G | Yes | No |
H | No | No |
I | Yes | Yes |
J |
So what I would like to achieve is have a pie chart visualisation that shows out of these 10 workplaces, how many have a "YES" in either having a water cooler or microwave.
Those workplaces without values were closed down.
So the pie chart should show 50% Yes (from A, C, D, G, I because they have "YES" in either columns) and 50% No (from B, E, F, H, J because they have "NO" in both columns/no values at all).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @matthewtjy ,
If there are many other columns like [Does workplace have a water cooler?] or [Does the workplace have a microwave?] ,please kindly refer to @Tahreem24 's method by pivoting the original table.
Or if there are just the two columns, please add a column with "Yes" or "No" flag:
Yes or No =
var _combine= COMBINEVALUES("," , [Does workplace have a water cooler?] ,[Does the workplace have a microwave?])
return IF(CONTAINSSTRING(_combine,"Yes"),"Yes","No")
Then create Pie visual:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @matthewtjy ,
If there are many other columns like [Does workplace have a water cooler?] or [Does the workplace have a microwave?] ,please kindly refer to @Tahreem24 's method by pivoting the original table.
Or if there are just the two columns, please add a column with "Yes" or "No" flag:
Yes or No =
var _combine= COMBINEVALUES("," , [Does workplace have a water cooler?] ,[Does the workplace have a microwave?])
return IF(CONTAINSSTRING(_combine,"Yes"),"Yes","No")
Then create Pie visual:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@matthewtjy try this:
Step1 : Go to power query editor and select Microwave and watercooler column then click on unpivot column under Transform tab.
Step 2: Close and Apply
Step 3: Create a measure like this:
Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@matthewtjy , Create a table with Two values yes and no. Then join it with both columns. One join will be inactive, that you can activate using userelationship Then you can have measure
Count(Table[Workplace]) +calculate(Count(Table[Workplace]) ,USERELATIONSHIP(dim[Yes/No],Table[Does the workplace have a microwave?]) )
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview. ✨
️ November 12th-14th, 2024
Online Event
Register Here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi I'm sorry but how do i go about to create a table with Two values yes and no. Then join it with both columns?
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Microsoft Fabric Community Conference 2025
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
Subject | Author | Posted | |
---|---|---|---|
06-07-2024 08:12 PM | |||
06-18-2023 11:34 PM | |||
08-17-2023 02:16 AM | |||
03-14-2024 02:14 AM | |||
06-27-2019 12:44 AM |
User | Count |
---|---|
123 | |
79 | |
59 | |
58 | |
44 |
User | Count |
---|---|
179 | |
120 | |
82 | |
70 | |
53 |