Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alhashmi
New Member

Count Error

Hello,

 

I need to make a graph showing how many times each person has their name in column "Done by" and "Checked by". The issue is that the graph "Checked By" is correct but the graph for "Done by" is not - it's appearing the values of the column "Checked by" ("Done by" does not even have black values).

 

Could you kindly advise on where the error might be coming from and how to correct? I've already tried to start a new one from scratch and I ended up with the same problem.

 

https://imgur.com/FuPlQp4 (Graphs described above.)

 

Thank you in advance.

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @alhashmi ,

 

Create one active relationship and on inactive relationship.

3.PNG

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.

5.PNG4.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @alhashmi ,

 

Create one active relationship and on inactive relationship.

3.PNG

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.

5.PNG4.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
az38
Community Champion
Community Champion

@alhashmi 

I don't see where is your [People] field?

does it connected via relationships or stored in the same table?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.