Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello, I Have two diferent tables, the first one is a Product Dimmension where I have just the products and I have a second one with sales. For each sale I can sell more than one product.
| Sale ID | Date | Product | Quantity |
| 1 | 01-01-2021 | A | 5 |
| 1 | 01-01-2021 | B | 10 |
| 2 | 01-01-2021 | A | 15 |
| 2 | 01-01-2021 | B | 5 |
| 2 | 01-01-2021 | C | 5 |
I need to know how many times (Diferent Sales ID) product A were sold togheter with product B. It must be in a DAX formula and not in a calculates coumn because I need to filter it by date.
Thanks
Solved! Go to Solution.
@CarlosSouzaBI , Create a measure like
countx(filter(summarize(filter(Table, Table[Product] in {"A","B"}), Table[Sale ID], "_1", distinctcount(Table[Product])), [_1]=2),[Sale ID])
@amitchandak Thanks,it almos work.
Probably I forgot to mention that I need to put it into a table, so when I filter product A in the context it appers like this:
Prodcut | Sold_Togheter
B | 3
C | 0
D |1
Thanks
@CarlosSouzaBI , Try a measure like
countx(Values(Table[Sale ID]), calculate(distinctcount(Table[Product]), filter(allselected(Table),table[Sale ID] = max(table[Sale ID]) && Table[Product] = "A" || Table[Product] =max(Table[Product]) )))
@CarlosSouzaBI , Create a measure like
countx(filter(summarize(filter(Table, Table[Product] in {"A","B"}), Table[Sale ID], "_1", distinctcount(Table[Product])), [_1]=2),[Sale ID])
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 45 | |
| 38 | |
| 16 | |
| 14 |
| User | Count |
|---|---|
| 87 | |
| 69 | |
| 38 | |
| 29 | |
| 26 |