Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Dear PowerBI community,
I am facing an issue with a visualization (stacked column). I am not sure if I need to make a new row…
I would like to use distinct count of my rows within my columns. I think it is explained best by giving an example:
I use something like this kind of dataset:
DummyX | UserID | Department |
Yes | 1 | X |
No | 1 | X |
Yes | 1 | X |
No | 2 | X |
No | 2 | X |
Yes | 2 | X |
Yes | 3 | Y |
Yes | 3 | Y |
Yes | 3 | Y |
No | 4 | Y |
Yes | 4 | Y |
I would like to summarize how many people are having a "No" in the first column, compared to the total number of Users per department.
If there is one row value in which there is a "No", then the count function should judge a user to be only counted as a "No".
So a figure (it is supposed to be a stacked column) would look then like the following, stacked on each other.
|
| 1x Yes |
2x No |
| 1x No |
X |
| Y |
At the moment, by using the distinctcount functionality in my visualization I get a visualization of the following in which some users are counted double if they have both a "Yes" and a "No":
2x Yes |
| 2x Yes |
2x No |
| 1x No |
X |
| Y |
I hope you could help me out… 🙂
Best,
Doeke
Solved! Go to Solution.
Thank for your reply! I understand that my explanation was not totally clear...
Eventually, I found the solution myself.
I combined two measures in my table:
1.
Anyway, thanks for your help! 🙂
Thank for your reply! I understand that my explanation was not totally clear...
Eventually, I found the solution myself.
I combined two measures in my table:
1.
Anyway, thanks for your help! 🙂
Glad to hear that! Please consider giving a thumbs up to my reply if that helped 🙂
I'm not sure if I understand what your final result table looks like, but here is a DAX measure to unique users who have "No" value in the first column.
Unique Users with At Least 1 No =
VAR __Users =
ADDCOLUMNS(
SUMMARIZE(
'Table',
'Table'[UserID]
),
"@MinDummy", CALCULATE( MINX( 'Table', 'Table'[DummyX] ) )
)
VAR __Res =
CALCULATE(
[Total Unique Users],
FILTER( __Users, [@MinDummy] = "No" )
)
RETURN
__Res
If this helps, please give it a thumbs up!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
102 | |
99 | |
38 | |
37 |
User | Count |
---|---|
158 | |
125 | |
76 | |
74 | |
63 |