The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
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.
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.
@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:
@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?]) )
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?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
77 | |
71 | |
48 | |
41 |
User | Count |
---|---|
137 | |
108 | |
69 | |
64 | |
58 |