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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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)

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)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.