Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
My table contains one row per order (i.e. I can have 3 rows, with 3 different products, but one order number)
I am trying to figure out a way to show orders that purchased this product (let's call it A) and any other one. For example, if I have 3 rows per order, one of which has product A, then all 3 rows would show (contains product A). If none of the rows has it, then (no product A).
OrderNumber Product Result
1 X No A
1 X No A
2 A Has A
2 X Has A
2 X Has A
3 X Has A
3 A Has A
I tried smth with CALCULATE(COUNTROWS), FILTER, EARLIER but no desired result 😞
Any help would be appreciated 🙂
Solved! Go to Solution.
HI @Anonymous
Can you try this as well?
Ex_contain = Var inExist =CALCULATE(COUNT(Table1[OrderNo]),FILTER(Table1,Table1[OrderNo]=EARLIER(Table1[OrderNo]) && Table1[Product]="A")) RETURN IF(inExist>0,"Has A","No A")
Thanks
Raj
Seems similar to a problem I solved in another thread. The function you want is CONTAINS. Bottom of this thread:
HI @Anonymous
Can you try this as well?
Ex_contain = Var inExist =CALCULATE(COUNT(Table1[OrderNo]),FILTER(Table1,Table1[OrderNo]=EARLIER(Table1[OrderNo]) && Table1[Product]="A")) RETURN IF(inExist>0,"Has A","No A")
Thanks
Raj
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |