The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have two tables:
Patients has unique idPatient
UPDRS has scores (multiple per patient) and is linked to Patients via idPatient
Here's my one-to-many relationship:
By everything I've read here and elsewhere this seems to be the right way to do it.
However, the simplest visual I could think of just shows the total number of patients for every option. I did a New Measure to count the number of patients.
Then I created a table visual with intQ18 (possible answers of 0 through 4) and that Measure. Since it didn't work I also tried letting PowerBI do a distinct count.
As an example: idPatient 1625 scored a 1, 2, and 4 at different times and should be counted in those buckets and not the other ones.
Things I have tried:
Your help is much appreciated.
Solved! Go to Solution.
@cjacobson change your DAX like this
Number Patients = DISTINCTCOUNT(udpr[idPatient])
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@cjacobson change your DAX like this
Number Patients = DISTINCTCOUNT(udpr[idPatient])
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Seems to have worked!
So the short version is "do your counting in the table that has 'many' IDs, not in the table that has 'one' ID". Is that correct? Is it only true for if the thing you are "grouping by" like my intQ18 is in the 'many' table?
Thank you!
@cjacobson it depends what you are trying to do, if you have using column from many side then your calculation should be on many side column, in this case you are counting by column from many side which cannot filter patient table, although that can be achieved by cross filter direction set to both.
So there are many option, it all depends what you are trying to achieve and how you set up you data model.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
79 | |
71 | |
48 | |
41 |
User | Count |
---|---|
138 | |
108 | |
71 | |
64 | |
58 |