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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Return The First Date the Staff Failed

Hi there,

 

I want to get the column which returns the first date that staff failed. The table may go like this:

 

Staff   | Date           | Passed?   | Flag                | First Date Failed

A        | 1/9/2021   | Failed       | Non Repeat   | 1/9/2021

A        | 1/10/2021 | Failed       | Repeat           | 1/9/2021

A        | 1/11/2021 | Failed       | Repeat           | 1/9/2021

A        | 1/12/2021 | Passed      | Non Repeat   |

A        | 1/1/2022   | Failed       | Non Repeat   | 1/1/2022

A        | 1/2/2022   | Failed        | Repeat          | 1/1/2022

 

I tried few workarounds like this

First Date Failed = IF(Table[Flag]="Non Repeat && Table[Passed?]="Failed", Table[Date], BLANK())

 

But this DAX only returns the one with first time fail date. Can help me with this?

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Create a calculated column formula to extract the Year

Year = year(Data[Date])

First date failed in year = if(Data[Passed?]="Failed",calculate(min(Data[Date]),filter(Data,Data[Staff]=earlier(Data[Staff])&&Data[Passed?]="Failed")),blank())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi, I tried on my report and it only returns the very first date, which is 1/9/2021 for all rows

Hi,

Try this

Year = year(Data[Date])

First date failed in year = if(Data[Passed?]="Failed",calculate(min(Data[Date]),filter(Data,Data[Staff]=earlier(Data[Staff])&&Data[Passed?]="Failed"&&Data[Year]=earlier(Data[Year]))),blank())


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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