Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 49 | |
| 44 | |
| 42 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 72 | |
| 66 | |
| 33 | |
| 32 | |
| 31 |