March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
PBIX with mock data is here . I've got two tables with a relationship between them, many-to-many if it matters. How can I write a DAX measure for each row in Table1 with the number of selected in values in the slicer for Table2[Color]. For example, if blue, green, and orange are selected in the slicer, I want this measure to return 3 for every row in Table1. Here's what I've tried:
Count Slicer Selections = COUNTROWS(DISTINCT(Table2[Color]))
This works fine in a card, but not when I display it in a table for Table1. It also works as intended if I delete the relationship between Table1 and Table2, but in the real use case I need this relationship for other purposes. What I'm currently getting instead is the number of colors available for each DeviceId after the slicer is applied, which varies by DeviceId.
Solved! Go to Solution.
I forgot some crucial information, so I'm going to create a new post. I can't find the delete button, so please ignore this post.
Hi @tonysantangelo ,
Have you considered using a bridge table to avoid the many to many relationship?
Here is some additional information:
https://www.phdata.io/blog/how-to-create-a-bridge-table-in-power-bi/
https://learn.microsoft.com/en-us/power-bi/guidance/relationships-many-to-many
I forgot some crucial information, so I'm going to create a new post. I can't find the delete button, so please ignore this post.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
87 | |
85 | |
76 | |
49 |
User | Count |
---|---|
163 | |
148 | |
103 | |
74 | |
55 |