Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
100 | |
80 | |
77 | |
66 |
User | Count |
---|---|
134 | |
106 | |
104 | |
85 | |
73 |