Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
HI All,
I am facing a situation where I need to find in a group of rows if a value A is present but value B is absent. Here is the input, the group is of Order ID.
| OrderId | EntryID | Value |
| 100 | 1 | A |
| 100 | 2 | B |
| 101 | 3 | A |
| 101 | 4 | A |
Output:
| OrderId | EntryID | Value | A not B flag |
| 100 | 1 | A | False |
| 100 | 2 | B | False |
| 101 | 3 | A | True |
| 101 | 4 | A | True |
Please help. Thanks in advance.
Solved! Go to Solution.
@Anonymous , Try a new column like
new column =
var _A = countx(filter(Table, [OrderId] = earlier([OrderId]) && [Value] = "A"), [Value])
var _B = countx(filter(Table, [OrderId] = earlier([OrderId]) && [Value] = "B"), [Value])
return
if(not(isblank(_A)) && isblank(_A), true(), false())
Hi,
This calculated column formula works
Test = not(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[OrderId]=EARLIER(Data[OrderId])&&Data[Value]="B"))>0)
Hope this helps.
Hi,
This calculated column formula works
Test = not(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[OrderId]=EARLIER(Data[OrderId])&&Data[Value]="B"))>0)
Hope this helps.
@Anonymous , Try a new column like
new column =
var _A = countx(filter(Table, [OrderId] = earlier([OrderId]) && [Value] = "A"), [Value])
var _B = countx(filter(Table, [OrderId] = earlier([OrderId]) && [Value] = "B"), [Value])
return
if(not(isblank(_A)) && isblank(_A), true(), false())
@amitchandakThanks this worked. Only changed I did was to modify the return statement as it was only considering A.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!