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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JaimeHernandezP
Regular Visitor

Filter Failed jobs

Hy there I'm so newby with modeling I try to filter failed jobs in my report

 

I have a table with 3 columns Jobs, Date status.

 

JOBDATESTATUS
app30/03/2022Failed
app30/03/2022Success
app31/03/2022Success

 

Jobs run daily. If a job fails, it runs again.

 

I am trying to extract only the failed jobs that have no successful results on the same day.

For example:

JOBDATESTATUSRESULT
app30/03/2022failed 
app30/03/2022successsuccess
app31/03/2022successsuccess
app1/04/2022failedfailed
app2/04/2022successsucces
    
5 REPLIES 5
v-kkf-msft
Community Support
Community Support

Hi @JaimeHernandezP ,

 

Please try the following formula:

 

Measure = 
VAR count_ =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[STATUS] ),
        ALLEXCEPT ( 'Table', 'Table'[DATE] )
    )
RETURN
    IF (
        count_ = 1,
        MAX ( 'Table'[STATUS] ),
        IF ( MAX ( 'Table'[STATUS] ) = "success", "success" )
    )

vkkfmsft_1-1649066936313.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@JaimeHernandezP , Create a measure like this one and plot with Job

 

Countx(Filter(Table, Table[Job], "_1", countrows(filter(Table, Table[STATUS] ="success")) , "_2", countrows(filter(Table, Table[STATUS] ="failed")))
isblank(_1) && not(Isblank(_2)))

Sorry. I tried but the syntax is wrong.

Capture.JPG

@JaimeHernandezP , Sorry my mistake

 

Try like

Countx(Filter(Summarize(Table, Table[Job], "_1", countrows(filter(Table, Table[STATUS] ="success")) , "_2", countrows(filter(Table, Table[STATUS] ="failed"))) ,isblank(_1) && not(Isblank(_2)) ) ,[JOB])

@amitchandak tank you so much for stepping.

 

I tried your command, but the error persists.Capture1.JPG

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors