Forum Discussion
Count Error
- Anonymous6 years ago
Hi alhashmi ,
Create one active relationship and on inactive relationship.
Use USERELATIONSHIP() function to create a measure for the inactive column.
Measure = CALCULATE(COUNT('Table'[Checked by]),USERELATIONSHIP('Table'[Checked by],Who[person]))Result would be shown as below.
Best Regards,
Jay
I don't see where is your [People] field?
does it connected via relationships or stored in the same table?
- alhashmi6 years agoNew Member
Thank you for the quick response.
It's connected via relationships, it has the values "Person A" "Person B" "Person C" and "Person D". At first I tried to use "Done by"/"Checked by" as axis, but due to the error I tried a different way to test out.
- mahoneypat6 years agoMicrosoft Employee
Since your relationship from the Who table can only be active with one of those fields at a time, you will need to use 1 of 2 approaches to count the other. Assuming the relationship is active with Done By, here are two solutions for Checked By
1. Make an inactive relationship between the People column and the Checked By column. Use a measure like this
Checked By Count = CALCULATE(COUNTROWS(Data), USERELATIONSHIP(Who[People], Data[Checked by]))
2. Use a measure like this
Checked By Count = CALCULATE(COUNTROWS(Data), TREATAS(VALUES(Who[People]), Data[Checked by]), ALL(Data[Done by]))
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat