Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
| JOB | DATE | STATUS |
| app | 30/03/2022 | Failed |
| app | 30/03/2022 | Success |
| app | 31/03/2022 | Success |
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:
| JOB | DATE | STATUS | RESULT |
| app | 30/03/2022 | failed | |
| app | 30/03/2022 | success | success |
| app | 31/03/2022 | success | success |
| app | 1/04/2022 | failed | failed |
| app | 2/04/2022 | success | succes |
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" )
)
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.
@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.
@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])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 10 | |
| 5 | |
| 5 |