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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.