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.
ID | Category | Expected Output |
1 | A | 1 |
1 | B | 1 |
1 | C | 1 |
2 | B | 0 |
2 | C | 0 |
2 | D | 0 |
3 | A | 1 |
3 | B | 1 |
4 | A | 0 |
4 | A | 0 |
4 | A | 0 |
I have a table like above , I need to find if a particular ID has "A" AND another category, then expected output is 1.
If ID has category A only , then 0. Also if no Category A , then also expected output is 0
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new column.
Expected output CC =
VAR _condition =
SUMMARIZE ( FILTER ( Data, Data[ID] = EARLIER ( Data[ID] ) ), Data[Category] )
RETURN
IF ( COUNTROWS ( _condition ) > 1 && "A" IN _condition, 1, 0 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a new column.
Expected output CC =
VAR _condition =
SUMMARIZE ( FILTER ( Data, Data[ID] = EARLIER ( Data[ID] ) ), Data[Category] )
RETURN
IF ( COUNTROWS ( _condition ) > 1 && "A" IN _condition, 1, 0 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big 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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |