Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have data that looks like this:
Its a row for every user in my clinical trials system, what their contact id is, and what department they're in.
I also have other data that is a row for every protocol we're tracking, one column of which is what department that protocol is in.
I'd like to create a visual like this (pictured, though not working perfectly yet), where I select a study, it shows what department that study is in, and then a pie chart that would show: "of the 821 total users, 328 of them are in that department"
It ALMOST works. All the data is linked to each other, and if I select a different dept the pie chart will change to reflect the users in that department, the problem is it doesn't keep the 'out of 821' as a total. The entire pie chart just becomes however many rows are in that department.
How do I get the pie chart to show percent of total rows?
Solved! Go to Solution.
Hi @JoeCrozier ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
var _select=SELECTCOLUMNS('Table',"1",[Department])
var _all=COUNTX(ALL('Table'),[User])
var _group=COUNTX(FILTER(ALL('Table'),'Table'[Department] in _select &&'Table'[Department]=MAX('Table'[Department])),[User])
return
DIVIDE(
_group,_all)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @JoeCrozier ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Measure =
var _select=SELECTCOLUMNS('Table',"1",[Department])
var _all=COUNTX(ALL('Table'),[User])
var _group=COUNTX(FILTER(ALL('Table'),'Table'[Department] in _select &&'Table'[Department]=MAX('Table'[Department])),[User])
return
DIVIDE(
_group,_all)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
User | Count |
---|---|
107 | |
89 | |
81 | |
76 | |
73 |
User | Count |
---|---|
112 | |
104 | |
96 | |
74 | |
66 |