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