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.
Hi Team,
Need overall status based on individual status.
PFB DATA
Job Status
job1 completed
job2 running
job3 cancelled
job4 Completd
i need overall status like if all jobs completed then complted ,if few jobs completed and few jobs running then running,if fewjobs completd and fewjobs running and few jobs cancelled then cancelled ,if few jobs active and few jobs cancelled then cancelled.
Please help me on this
Regards,
Ravi
Solved! Go to Solution.
Hi, @Anonymous
You may create a measure like below to see if it works.
Overall Status =
var _completed =
CALCULATE(
DISTINCTCOUNT('PFB DATA'[Job]),
FILTER(
ALL('PFB DATA'),
'PFB DATA'[Status]="completed"
)
)
var _running =
CALCULATE(
DISTINCTCOUNT('PFB DATA'[Job]),
FILTER(
ALL('PFB DATA'),
'PFB DATA'[Status]="running"
)
)
var _cancelled =
CALCULATE(
DISTINCTCOUNT('PFB DATA'[Job]),
FILTER(
ALL('PFB DATA'),
'PFB DATA'[Status]="cancelled"
)
)
return
IF(
_cancelled>0,
"cancelled",
IF(
_completed = CALCULATE(DISTINCTCOUNT('PFB DATA'[Job]),ALL('PFB DATA')),
"completed",
"running"
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.
Best Regards
Allan
Hi, @Anonymous
You may create a measure like below to see if it works.
Overall Status =
var _completed =
CALCULATE(
DISTINCTCOUNT('PFB DATA'[Job]),
FILTER(
ALL('PFB DATA'),
'PFB DATA'[Status]="completed"
)
)
var _running =
CALCULATE(
DISTINCTCOUNT('PFB DATA'[Job]),
FILTER(
ALL('PFB DATA'),
'PFB DATA'[Status]="running"
)
)
var _cancelled =
CALCULATE(
DISTINCTCOUNT('PFB DATA'[Job]),
FILTER(
ALL('PFB DATA'),
'PFB DATA'[Status]="cancelled"
)
)
return
IF(
_cancelled>0,
"cancelled",
IF(
_completed = CALCULATE(DISTINCTCOUNT('PFB DATA'[Job]),ALL('PFB DATA')),
"completed",
"running"
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I think you can use this measure to display the status based on your criteria:
JobStatus = if(CONTAINS(Jobs,Jobs[status], "Cancelled"), "Cancelled", if(CONTAINS(Jobs, Jobs[status], "Running"), "Running", "Completed") )
Hi @Anonymous
try a column
Overall =
SWITCH(TRUE(),
CALCULATE(COUNTROWS(Table), Table[Status] = "Cancelled") > 0, "Cancelled",
CALCULATE(COUNTROWS(Table), Table[Status] = "running") > 0, "running",
"completed"
)
cureently i have data in status column like completed and cancelled for above logic i am getting two i need only cancelled
Hi @Anonymous ,
Assuming you have only these 3 status.
Try this measures
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
@Anonymous ,
Please share sample data and a better description to your problem.
Regards,
HN
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 |
---|---|
114 | |
100 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |