Forum Discussion
Count One to Many Relationship
- 6 years ago
hi, luisc
This is a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907For your case, when you count of id_pessoa (pessoa table) , It likes a measure as below:
Measure = CALCULATE(COUNTA(pessoa[id_pessoa]))and when you count of person_id (scoring table), it likes a measure as below:Measure 2 = CALCULATE(COUNTA(scoring[person_id]))So for your case, just try to use this formula to create a measureOutput = var _table=ADDCOLUMNS(scoring,"_id_pessod",RELATED(pessoa[id_pessoa])) return COUNTAX(_table,[_id_pessod])
Result:for example:and here is my sample pbix file, please try it.Regards,
Lin
hi, luisc
This is a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
For your case, when you count of id_pessoa (pessoa table) , It likes a measure as below:
Output = var _table=ADDCOLUMNS(scoring,"_id_pessod",RELATED(pessoa[id_pessoa])) return COUNTAX(_table,[_id_pessod])Result:
Regards,
Lin
Thanks for the help and the posts.
Was really hoping that this was a problem with the model, since this is something that the users used to do in our other BI.