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

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

Reply
Anonymous
Not applicable

How to count the rows where sequence of the process is incorrect?

Hi all,

I am fairly new to PBI and I need help figuring out solution to a problem I am facing.

I have given below a simplified version of the data set I am handling.

 

Abyss_0-1666779945412.png

I need to count the number of rows which have the steps in the wrong order by date. I also need to display the information of candidate whose order is wrong.

The output would look something like :

Abyss_1-1666780099863.png

Egs: Here I would need to display the details of candidate ID: 104 as the order of steps is wrong for the candidate.

Abyss_2-1666780273781.png

For candidate ID 104, the date of step "3. Offer" comes before the Screening date, which is in the wrong order.
I tried creating a calculated column below, but it doesn't seem to do the trick.

# of wrong sequence = COUNTAX(FILTER('Status Changes', EARLIER('Status Changes'[Job  ID]) = 'Status Changes'[Job ID] && EARLIER('Status Changes'[Candidate ID]) = 'Status Changes'[Candidate ID] && EARLIER('Status Changes'[Application ID]) = 'Status Changes'[Application ID]), IF ( 'Status Changes'[Created Date]> EARLIER ('Status Changes'[Created Date]) && 'Status Changes'[Steps]< EARLIER ('Status Changes'[Steps]), 1, 0 ) )



Any help is appreciated, thanks in advance.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Hope someone can provide a more concise scheme.

step1 = 
var step = CALCULATE(MAX('Table'[created date]),FILTER('Table','Table'[candidate ID]=EARLIER('Table'[candidate ID])&&'Table'[steps]="applied"))
return
IF(ISBLANK(step),DATE(2099,1,1),step)

step2 = 
var step = CALCULATE(MAX('Table'[created date]),FILTER('Table','Table'[candidate ID]=EARLIER('Table'[candidate ID])&&'Table'[steps]="screening"))
return
IF(ISBLANK(step),DATE(2099,1,1),step)

step3 = 
var step = CALCULATE(MAX('Table'[created date]),FILTER('Table','Table'[candidate ID]=EARLIER('Table'[candidate ID])&&'Table'[steps]="offer"))
return
IF(ISBLANK(step),DATE(2099,1,1),step)

Column = IF('Table'[step1]>'Table'[step2]||'Table'[step1]>'Table'[step3]||'Table'[step2]>'Table'[step3],'Table'[candidate ID],BLANK())

 

vjaywmsft_0-1666863574681.png

 

Best Regards,

Jay

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

Hope someone can provide a more concise scheme.

step1 = 
var step = CALCULATE(MAX('Table'[created date]),FILTER('Table','Table'[candidate ID]=EARLIER('Table'[candidate ID])&&'Table'[steps]="applied"))
return
IF(ISBLANK(step),DATE(2099,1,1),step)

step2 = 
var step = CALCULATE(MAX('Table'[created date]),FILTER('Table','Table'[candidate ID]=EARLIER('Table'[candidate ID])&&'Table'[steps]="screening"))
return
IF(ISBLANK(step),DATE(2099,1,1),step)

step3 = 
var step = CALCULATE(MAX('Table'[created date]),FILTER('Table','Table'[candidate ID]=EARLIER('Table'[candidate ID])&&'Table'[steps]="offer"))
return
IF(ISBLANK(step),DATE(2099,1,1),step)

Column = IF('Table'[step1]>'Table'[step2]||'Table'[step1]>'Table'[step3]||'Table'[step2]>'Table'[step3],'Table'[candidate ID],BLANK())

 

vjaywmsft_0-1666863574681.png

 

Best Regards,

Jay

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.