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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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