Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a "Transactions" table with the following structure:
ID | Product | OrderCode | Value
1 | 8 | ABC | 100
2 | 5 | ABC | 150
3 | 4 | ABC | 80
4 | 5 | XPT | 100
5 | 6 | XPT | 100
6 | 8 | XPT | 100
7 | 5 | XYZ | 100
8 | 8 | UYI | 90
How do I create a table (or list) with the order codes of orders with both products 5 and 8?
In the example above it should be orders ABC and XPT.
Thank you!
Solved! Go to Solution.
I might look at this in more detail but at first glance it looks very similar to the problem that I wrote my "Patient Cohort" Quick Measure to solve.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Patient-Cohort/m-p/391883
Hi @webportal,
You can new a calculated table:
New Table =
FILTER (
Table,
CALCULATE (
DISTINCTCOUNT ( Table[Product] ),
FILTER ( ALLEXCEPT ( Table, Table[OrderCode] ), Table[Product] = 5 )
)
+ CALCULATE (
DISTINCTCOUNT ( Table[Product] ),
FILTER ( ALLEXCEPT ( Table, Table[OrderCode] ), Table[Product] = 8 )
)
>= 2
)
Regards,
Yuliana Gu
Hi,
What is your expected result?
I might look at this in more detail but at first glance it looks very similar to the problem that I wrote my "Patient Cohort" Quick Measure to solve.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Patient-Cohort/m-p/391883
@Greg_Deckler this works very well, thanks for sharing!
But how to return tmpTable3 as a table instead of a card with a comma separated string? If there are many patients in the cohort (orders in my case) the card won't do.
Thank you so much for helping!
@webportal
if you use UNICHAR(10) (line break) instead of "," as separator it CONCATENATEX it should improve readability, still it's not a table per se. just a workaround
I will look into that. I really, really, really wish that table and matrix visualizations accepted a measure that returned a table as a valid input. That would solve sooooooo many problems...
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.