Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
68 | |
48 | |
45 | |
18 | |
15 |