Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Currently my code works if it meets one of the 3 choices at least once. If the group (Identifier) has at least "Row1","Row2","Row3" at least once it will be flagged. The adjustment I want to make is if the group has "Row1","Row2", and "Row3" filled.
Flag =
VAR Flag1 =
CALCULATE(
COUNTROWS('Identifier Table'),
FILTER('Identifier Table','Identifier Table'[Identifier]=EARLIER('Identifier Table'[Identifier]) && 'Identifier'[Identifier] IN { "Row1","Row2","Row3"}
)
)
RETURN
IF(Flag1 >0 , "Flag", "No Flag")
Currently
ID | Col1 | Flag |
1 | Row2 | Yes |
1 | Row2 | Yes |
1 | Row1 | Yes |
2 | Row3 | Yes |
2 | Row2 | Yes |
2 | Row1 | Yes |
3 | Row1 | Yes |
4 | Row4 | No |
I want the table to look like this
|
Solved! Go to Solution.
HI @user35131,
I'd like to suggest you add values function to remove duplicate values from the table at first, then you can use this list to get the unique item count of specific items to return flag:
NewFlag =
VAR _list =
CALCULATETABLE (
VALUES ( 'Table'[Col1] ),
FILTER (
ALL ( 'Table' ),
[ID] = EARLIER ( 'Table'[ID] )
&& [Col1] IN { "Row1", "Row2", "Row3" }
)
)
RETURN
IF ( COUNTROWS ( _list ) = 3, "Yes", "No" )
Regards,
Xiaoxin Sheng
HI @user35131,
I'd like to suggest you add values function to remove duplicate values from the table at first, then you can use this list to get the unique item count of specific items to return flag:
NewFlag =
VAR _list =
CALCULATETABLE (
VALUES ( 'Table'[Col1] ),
FILTER (
ALL ( 'Table' ),
[ID] = EARLIER ( 'Table'[ID] )
&& [Col1] IN { "Row1", "Row2", "Row3" }
)
)
RETURN
IF ( COUNTROWS ( _list ) = 3, "Yes", "No" )
Regards,
Xiaoxin Sheng
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.