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
SushmaReddy
Helper I
Helper I

To get the count of Error records

Hi Team,

I have a requirement where i have to display Failed and Error count on card visuals.

and the logic I got for Failed count is

Failed = VAR _M = SUMMARIZE(T1,T1[Model Number],
"MAX",MAX(T1[Processing Date]),
"Status",CALCULATE(MAX(T1[Status]),
FILTER(T1,T1[Model Number]=EARLIER(Model Number]))))
return
COUNTROWS(FILTER(_M,[Status]="Failed"))+
I am splitting the Error column and have to get the count after splitting.I am applying the same logic to get the count but after splitting the count should be shown as 2.
eg: Before Splitting
Model Number     Date     Status     Error
        123                17/7    Failed      xyz|abc
After Splitting
Model Number     Date     Status     Error
        123                17/7    Failed      xyz
        123                17/7    Failed      abc
O/P:Failed=1
       Error=2
Please let me know how to fix this and thank you in advance.
 
Best Regards
Sushma
 
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @SushmaReddy 

Thanks for reaching out to us.

>> I have a requirement where i have to display Failed and Error count on card visuals.

You can try this split operation, it will contain the number of your errors

vxiaotang_0-1661498114399.png

vxiaotang_1-1661498125760.png

ErrorCount = CALCULATE(DISTINCTCOUNT(T1[Attribute]),T1[Status]="Failed")
FailedCount = CALCULATE(DISTINCTCOUNT(T1[Date]),T1[Status]="Failed")

result

vxiaotang_2-1661499093108.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @SushmaReddy 

Thanks for reaching out to us.

>> I have a requirement where i have to display Failed and Error count on card visuals.

You can try this split operation, it will contain the number of your errors

vxiaotang_0-1661498114399.png

vxiaotang_1-1661498125760.png

ErrorCount = CALCULATE(DISTINCTCOUNT(T1[Attribute]),T1[Status]="Failed")
FailedCount = CALCULATE(DISTINCTCOUNT(T1[Date]),T1[Status]="Failed")

result

vxiaotang_2-1661499093108.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

@SushmaReddy 

did you split column in PQ?

based on the sample data, i think you can use count and distinctcount to get 2 and 1.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yes the column is splitted in PQ and i tried using count and distinct count but it didn't work...

@SushmaReddy 

maybe you can try this

Failed = CALCULATE(DISTINCTCOUNT('Table'[model]),'Table'[status]="Failed")
_Error = CALCULATE(count('Table'[status]),'Table'[status]="Failed")
 
1.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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