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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
NoviceBloke12
Frequent Visitor

DAX to Count instances in a column when outcome changes on the same date

I have a table below where I need to find the occurances where the Application status changes from Incomplete to complete for the same application ID's on the same day. 

DateApplication IDOutcomeApplication Start TimeApplication End TImeOccurrence
30-06-2021123456789Incomplete30-06-2021 15:4430-06-2021 15:53 
02-07-2021123456789Incomplete02-07-2021 14:5702-07-2021 15:04 
02-07-2021123456789Complete02-07-2021 14:5702-07-2021 15:041
30-06-2021234567891Incomplete30-06-2021 15:4430-06-2021 15:53 
02-07-2021234567891Incomplete02-07-2021 14:5702-07-2021 15:04 
03-07-2021234567891Complete03-07-2021 14:5703-07-2021 15:040
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NoviceBloke12 , Create a new column like

 

 


var _max = maxx(filter(Table, [Application ID] = earlier([Application ID]) && [Application End TIme] < earlier([Application End TIme]),[Application End TIme])
var _st = maxx(filter(Table, [Application ID] = earlier([Application ID]) && [Application End TIme] =_max && [date] = earlier([date]) ),[Outcome])
return
if([Outcome] = "Complete" && [Outcome] = "Incomplete", 1, 0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@NoviceBloke12 , Create a new column like

 

 


var _max = maxx(filter(Table, [Application ID] = earlier([Application ID]) && [Application End TIme] < earlier([Application End TIme]),[Application End TIme])
var _st = maxx(filter(Table, [Application ID] = earlier([Application ID]) && [Application End TIme] =_max && [date] = earlier([date]) ),[Outcome])
return
if([Outcome] = "Complete" && [Outcome] = "Incomplete", 1, 0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.