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
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
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.