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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
GON76
Helper III
Helper III

Count of values not accurate

I'm trying to set up a card visual that counts a particular value on my matrix table.  As you can see from the screenshot, the visual is showing 32 values that equal "Not Compliant" but the table is showing only 5.  I'm using the following formula: 

 

COUNTROWS ( FILTER ( Table, Table [Column] = "Value" ) )
 

not_compliant.jpg

There is a filter on this view, but shouldn't the card only be counting 5 "Not Compliant" values?

 

Thanks!

40 REPLIES 40
v-venuppu
Community Support
Community Support

Hi @GON76 ,

Sorry for the delay in Response..!!

Thank you for reaching out to Microsoft Fabric Community.

Thank you @d_m_LNK @wardy912 @jithin-mathew @Ashish_Mathur  for the prompt response.

 

Please go through the attached PBIX file for your reference.

If the issue still persists, I would request you to share the sample PBIX file, so that it will be helpful for us to solve the issue more effectively.

wardy912
Impactful Individual
Impactful Individual

Hi @GON76 

 

 Sorry, mines still working. As long as you use the measure rather than the calculated column in your card visual, and you replace the measure information with your table name and column you're using it will work:

 

wardy912_0-1753974089622.png

 

 

Would it make a difference if the course titles are headers and the completion date are values?

wardy912
Impactful Individual
Impactful Individual

No, but check something else please.

Check your slicer interactions with the card visual

 

Go to format, edit interactions, select the slicer and make sure this isn't selected (dark grey circle icon)

 

wardy912_0-1753975426784.png

 

Deselected so that slicer is effective

 

wardy912_1-1753975526408.png

 

 

 

 

 

This is what I'm seeing.

notcompliant6.jpg

wardy912
Impactful Individual
Impactful Individual

Hi @GON76 

 

 Can you take a step back please and add the column to a table visual to show the actual count of 'not compliant', the matrix visual may be combining results so hiding the real number. Once that's confirmed you will be able to add other columns to find out what's causing the issue. Maybe it's the categories. At that point you can edit your measure to count categories that contain the value 'not compliant' rather than counting every row that contains 'not compliant'.

 

Another method would be to create a visual calculation that counts rows containing 'not compliant' to only count the rows in the matrix rather than the source data table.

Here's a screeshot.  The formula for the Count of Compliance should mark all compliance dates older than 3 years "Not Compliant".  It's a calculated column if that makes any difference.

notcompliant3.jpg

Thanks! One last thing to check, are there any additional filters on the Matrix visual itself that aren't applied to the page as a whole?

Yes, there's one that filters out certain characters for the USERNAME.  Should I apply it to the page instead?

Yes please give that a try as we continue to see them filtered differently.

I just tried that, and no luck.

Based on this screenshot -- you are using the calculated column as the value for the visual with an implicit measure doing the count.  You need to create a measure with the code given in previous threads and make sure the card visual is using the measure and not the calculated column as the value.

So I deleted the measure I was using, and recreated it with one of the formulas someone suggested. It's still not working: 

 

Not Compliant = CALCULATE( COUNT('V_ENROLLMENTS'[Compliance Status]) ,ALLSELECTED('V_Enrollments') ,'V_ENROLLMENTS'[Compliance Status] = "Not Compliant"
 
At this point, I might just remove the cards.  Sorry it's so frustrating.

Also change the measure back to this code:

Not Compliant = CALCULATECOUNTROWS('V_ENROLLMENTS') ,'V_ENROLLMENTS'[Compliance Status] = "Not Compliant"

Thanks for trying that, can you send another screenshot like above with the card visual selected showing and the measure definition?

Sure, let me know if this is what you're asking for.notcompliant7jpg.jpg

wardy912
Impactful Individual
Impactful Individual

There are a couple of stand out points.

First, you now have 8 instances of 'not compliant'. Second, you have courses that are showing as 'not compliant' and 'compliant', so you might need to edit your calculated column to fix that as well.

 

We will need a dataset to fix this, but that doesn't need to be a full download. Add all of the columns to a table visual and click the 3 dots on the top right on the visual, export as a csv. Once we have that table it will be quick to fix, thanks

I copied a portion of the data table and removed the PII data.  So what I was trying to do was show the Learning Path Completion status as Complete if the student had a completion date for all of the courses.  The Learning Path Compliance is supposed to show "Not Compliant" if any of their completion dates were before 3 years from today. I wasn't sure how to upload the CSV file itself.  Is this what you need?  Thanks for your help.

USERNAMEFD_DIV_DESCRFD_REGIONCompliance StatusLearning Path Completion StatusCourse TitleCompletion Date
AABBADOFWASNot CompliantCompletePerformance Management Program5/10/2022 0:00
AAGAPOVRMSNYNot CompliantCompletePerformance Management Program3/29/2022 0:00
AALLALDRRWASNot CompliantCompleteCorrective Actions: Managing Conduct & Performance3/4/2023 12:00
AALLALDRRWASNot CompliantCompleteFoundations of Supervisory Leadership Part I6/9/2023 0:00
AALLALDRRWASNot CompliantCompleteFoundations of Supervisory Leadership Part II9/15/2023 0:00
AALLALDRRWASNot CompliantCompletePerformance Management Program11/1/2022 0:00
AAMICANGIOLIRMSNYNot CompliantCompleteCorrective Actions: Managing Conduct & Performance11/24/2021 0:00
AAMICANGIOLIRMSNYNot CompliantCompleteFoundations of Supervisory Leadership Part II3/11/2022 0:00
AAMONTGOMERYDCPWASNot CompliantCompletePerformance Management Program2/2/2024 12:01
AAPPULINGAMOCISOWASCompliantCompleteDelivering Employee Feedback7/16/2025 8:12
AAPPULINGAMOCISOWASNot CompliantCompleteCorrective Actions: Managing Conduct & Performance6/18/2024 17:59
AAPPULINGAMOCISOWASNot CompliantCompleteFoundations of Supervisory Leadership Part I6/28/2024 13:15
AARMOORELEGALDALNot CompliantCompleteCorrective Actions: Managing Conduct & Performance1/6/2023 15:52
AARMOORELEGALDALNot CompliantCompleteFoundations of Supervisory Leadership Part I2/3/2023 0:00
AARMOORELEGALDALNot CompliantCompleteFoundations of Supervisory Leadership Part II4/28/2023 0:00
AARMOORELEGALDALNot CompliantCompletePerformance Management Program4/21/2025 12:23
AASONYEDOAWASNot CompliantCompleteCorrective Actions: Managing Conduct & Performance4/22/2019 0:00
AASONYEDOAWASNot CompliantCompleteFoundations of Supervisory Leadership Part I5/3/2019 0:00
AASONYEDOAWASNot CompliantCompleteFoundations of Supervisory Leadership Part II8/2/2019 0:00
ABABRAHAMDOFWASNot CompliantCompletePerformance Management Program1/2/2024 8:25
ABARBESDCPWASNot CompliantCompletePerformance Management Program3/6/2023 9:48
ABBOWMANDCPKCNot CompliantCompletePerformance Management Program4/9/2024 12:42
ABICAKOCISOWASNot CompliantCompletePerformance Management Program3/29/2022 0:00
ABIRONDCPNYNot CompliantCompletePerformance Management Program7/31/2023 16:01
ABLANCHARDDOAWASNot CompliantCompletePerformance Management Program3/28/2022 0:00
ABONDIRMSNYNot CompliantCompletePerformance Management Program3/28/2022 0:00
wardy912
Impactful Individual
Impactful Individual

Hi @GON76 

 

 I am now using the data you have provided.

As you can see, the matrix visual (by design) groups the results by course title (or whatever column you use for the rows), whereas the card visual shows the count of 'not compliant' in the data source. This is all correct.

wardy912_0-1753949161921.png

What you're trying to achieve, is a count of 'not compliant' as it relates to the rows in your matrix, therefore you need to add that logic to your calculation. Add a measure (not a calculated column as this will iterate across all rows) as follows:

 

NonCompliantMeasure = 
CALCULATE(
    DISTINCTCOUNT('Compliance'[Course Title]),
    'Compliance'[Compliance Status] = "Not Compliant"
)

 

This results in:

 

wardy912_1-1753949722411.png

In the measure, swap out the 'course title' for whatever column you are using in your matrix 'rows'

 

wardy912_2-1753949853939.png

 

I hope this helps, please give a thumbs up and mark as solved if it does, thanks!

 

 

Hi, thanks for taking the time to look at this.  Unfortunately, it didn't work.  Maybe it would help if I provided the formula for the calculated column.

 

Compliance Status Column:

 

Compliance Status =
IF(
    V_ENROLLMENTS[EXITDATE].[Date] < EDATE(TODAY(), -3),
    "Not Compliant",
    "Compliant"
)
The EXITDATE is the date of the completion of the course.  What I'm trying to show is if any course's EXITDATE is older than 3 years, "Not Complaint" would show.  Does that make sense?
 
EXITDATE is on the a table called V_ENROLLMENTS
 
Thanks again for your help.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors