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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rtassicker
Frequent Visitor

New user issue - Count of counts

Hi There,

 

I am new to using PowerBI, I am using an organisational data set in tandem with self-directed learning. Our data set is the output of monthly data quality exercises, so each record shows an ID number, a data input that has been checked, and a column that contains the text ERROR if there was a an error in that data element. Each ID number has around 50 data inputs to check that may or may not show ERROR. 

 

It is straightforward enough to show a count of ERRORs for a given ID number:

 

Error Counts.png

 

What I would like to do is to be able to count the ID numbers which have 0 errors, 1 error, 2 errors, 3 errors and so on, in order to display in visualisations whether all the errors are concentrated in a small number of records, or spread out with a few here and there. I have tried a few different approaches but I am not yet experienced enough to know the right way to go about it.

 

Any help will be greatly appreciated!

 

Thanks,

Russell

1 ACCEPTED SOLUTION
rajulshah
Super User
Super User

Hello @rtassicker,

 

I have created a table with 2 columns - Grant Number and Errors.
Then I created calculated columns as below:

IsError = IF(Errors[Errors]<>"",1)
NumberofErrors = CALCULATE(COUNT(Errors[IsError]),FILTER(ALL(Errors),Errors[Grant Number]=EARLIER(Errors[Grant Number])))

 

Then I plot these columns in table visual as follows:
errors.pngHere, please select "Don't summarize" for NumberofErrors and "Count" for Grant Number.

Hope this helps

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Refer to this article - https://www.daxpatterns.com/dynamic-segmentation/.  Since this solution uses only measures, the result would respond to slicer selections.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish, that's a little beyond me at the moment but it looks very useful 🙂

Tara_
Helper II
Helper II

Hi @rtassicker ,

 

You can create a measure that counts the Grant Numbers and use it in the visuals alongside the errors. I created a sample table as below. Hope this helps.

 

Measure:

GrantCounts = COUNT(Grants[Grant Number])

 

Visuals:

errors Power BI Desktop.jpg

 

Thanks for the help Tara!

rajulshah
Super User
Super User

Hello @rtassicker,

 

I have created a table with 2 columns - Grant Number and Errors.
Then I created calculated columns as below:

IsError = IF(Errors[Errors]<>"",1)
NumberofErrors = CALCULATE(COUNT(Errors[IsError]),FILTER(ALL(Errors),Errors[Grant Number]=EARLIER(Errors[Grant Number])))

 

Then I plot these columns in table visual as follows:
errors.pngHere, please select "Don't summarize" for NumberofErrors and "Count" for Grant Number.

Hope this helps

Thanks rajulshah, that's helped me find the solution 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.