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.
I have the following table
1 | User name | User group | Output Column |
2 | User 1 | ||
3 | User 1 | Group A | Group A |
4 | User 1 | Group B | Group B |
5 | User 2 | User 2 | |
6 | User 3 | Group A | Group A |
Basically I want my output column to show groups or users only if they do no belong to any group. For example above.
User 1 has a null row in the 2nd line but User 1 also belongs to Group A & Group B. So in my output I do not want to have User 1 as value in the 2nd row . Similarly, User 2 does not belong to any group so I want to show User 2 as value in my output column.
Solved! Go to Solution.
Hi @newpi ,
Create a Calculated Column
Op Column =
var a = CALCULATE(Count('Table'[User name]), FILTER('Table', 'Table'[User name] = EARLIER('Table'[User name])))
RETURN
IF(a = 1 && 'Table'[User group] = BLANK(), 'Table'[User name], 'Table'[User group])
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
@newpi , Try a new column like
Output Column =
var _1 = countx(filter(table,[User name] =earlier([User name]),[User group]))+0
return
switch( true() ,
isblank([User group]) && blank(_1)=0, [User name],
isblank([User group]) && blank(_1)>=0, blank(),
[User group]
)
Hi @newpi ,
Create a Calculated Column
Op Column =
var a = CALCULATE(Count('Table'[User name]), FILTER('Table', 'Table'[User name] = EARLIER('Table'[User name])))
RETURN
IF(a = 1 && 'Table'[User group] = BLANK(), 'Table'[User name], 'Table'[User group])
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Thanks @harshnathani this works. Only. 1 question though, I'm still trying to understand the formula but because of earlier function or anything else in the measure, is it necessary that all user 1 rows should be in sequence (row 2,3,4 here)? The same user can also be out of sequence right? meaning on rows (2,3 & 5).
Also is there a way to not show up blank in the filter slicer?
HI @newpi ,
Yes, it can be out of sequence.
To understand the EARLIER formula, please see this video.
https://www.youtube.com/watch?v=lyhS2txtZ44&vl=en
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Thanks @harshnathani The formula is also creating blanks (which we want it to) and grouping all user 1 under that blank and showing blank as a value in the slicer. Anyway to get rid of that?
Hi @newpi ,
Use the Visual Filter
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |