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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
StephenK2022
Frequent Visitor

Count function not counting correctly

Hi,

 

I am trying to count the number of times an operator has logged data on our reporting system but the count function in the table tools isn't giving the correct output.

 

I am counting the number of instances the column "job code" appears for each operator - In the example below, the table has counted 99 instances of "job code" but if we look at the data there are only 19?

 

StephenK2022_0-1658932850662.pngStephenK2022_1-1658932881137.png

 

StephenK2022_2-1658932997451.png

 

Can someone please explain what I am doing wrong here?

 

Many Thanks in advance

1 ACCEPTED SOLUTION
pmay
Resolver I
Resolver I

Another good test is rather than using the operator field as the first column (which we know is from another table), use the "Name" field from the last screenshot you posted, as it's in the same table.  I understand the formatting is not nice, but let's just see if the count works properly.

 

If it counts to 19 for Tomasz, then the problem is with your relationship between your tables.  If it counts to 99 for Tomasz, then the problem is that you are expecting the wrong result (i.e. with the filters you have applied, 99 is actually the correct answer - maybe your date slicer isn't related to your data correctly).

 

The relationships can be viewed in the Model view (the last of the 3 buttons in your left pane).

The filters being applied to your table can be viewed by hovering over the Filter Header Icon in the top right of your table-visual - this will include which slicers are impacting on the table.

View solution in original post

3 REPLIES 3
pmay
Resolver I
Resolver I

Another good test is rather than using the operator field as the first column (which we know is from another table), use the "Name" field from the last screenshot you posted, as it's in the same table.  I understand the formatting is not nice, but let's just see if the count works properly.

 

If it counts to 19 for Tomasz, then the problem is with your relationship between your tables.  If it counts to 99 for Tomasz, then the problem is that you are expecting the wrong result (i.e. with the filters you have applied, 99 is actually the correct answer - maybe your date slicer isn't related to your data correctly).

 

The relationships can be viewed in the Model view (the last of the 3 buttons in your left pane).

The filters being applied to your table can be viewed by hovering over the Filter Header Icon in the top right of your table-visual - this will include which slicers are impacting on the table.

pmay
Resolver I
Resolver I

Is "Count of Job" a measure, or have you dragged a column?  Which column did you drag?  In the data view, I do not see a "Job" column.  
There are 2 different formats for the operators name, so there is a relationship involved here too?  Where does the "Operator" field in your table come from?  You could add the date to the next level, turn it into a matrix, and then you will see when exactly it thinks each of those 99 jobs occurred.  That might help you find the issue.

Hi,

 

Thanks for your reply. Count of Job is just a dragged column, It is taken from the first column in the Data view.

StephenK2022_0-1658938697134.png

There is no relationship between the different types of operator names, it is just the way the names have been input into our system

 

The operator field comes from a merged table which matches the "job" column on two different reports to pull the data together. I.e, one report pulls in data automatically from our system and the second report is data manually input by the operator.

 

I will try adding the date and see if that sheds any light. 

 

Mnay Thanks

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.