Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
91 | |
86 | |
85 | |
68 | |
49 |
User | Count |
---|---|
139 | |
112 | |
104 | |
64 | |
60 |