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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
s_chayaphon
New Member

count with over calculation

Hi,

 

I've data as below sample, and I want to count on how many App Delay, Failed and Ontime.

As you can see one app have many batch if one batch failed then the app define as failed if there is no fail but delay then the app deifne as delay and if no fail and delay then the app define as ontime

 

I'd like to create measure from below table to show in Card KPI for Number of App Ontime, Delay and Failed

by below sample data it should show :
App Otime = 1
App Delay = 1
App Failed = 2

Total App = 4

 

s_chayaphon_0-1684918767830.png

 

Could you pelase advise how to write DAX for create meausre for App Otime, App Delay and App Failed using in Card KPI.

Thanks

 

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @s_chayaphon 

Manually create FilterTable that contains the three App Status values:

Otime
Delay 
Failed 


then count measure would be

Count =
SUMX (
CROSSJOIN ( VALUES ( FilterTable[App Status] ), VALUES ( 'Table'[App] ) ),
INT (
FilterTable[App Status]
IN SELECTCOLUMNS (
TOPN ( 1, CALCULATETABLE ( 'Table' ), 'Table'[Status Code] ),
"@Status", 'Table'[Status]
)
)
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @s_chayaphon 

Manually create FilterTable that contains the three App Status values:

Otime
Delay 
Failed 


then count measure would be

Count =
SUMX (
CROSSJOIN ( VALUES ( FilterTable[App Status] ), VALUES ( 'Table'[App] ) ),
INT (
FilterTable[App Status]
IN SELECTCOLUMNS (
TOPN ( 1, CALCULATETABLE ( 'Table' ), 'Table'[Status Code] ),
"@Status", 'Table'[Status]
)
)
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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