March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |