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,
I have a requirement to count completed projects which has sub-task and each sub-task has a status field that has value 0(pending) or 1(completed). So, a project should be count as completed only if all these tasks have the status value set as 1. I want to use this measure/column in a clustered column graph and a table that will have all other details related to the project. Any help will be appreciated.
Thanks.
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Count Complete =
var tab =
SUMMARIZE(
'Table',
'Table'[Project],
"Flag",
var _project = [Project]
return
IF(
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Project]=_project
)
)=
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Project]=_project&&
'Table'[Task_Status]=1
)
),1,0
)
)
var _result =
SUMX(
tab,
[Flag]
)
return
IF(
ISBLANK(_result),
0,
_result
)
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
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure as below.
Count Complete =
var tab =
SUMMARIZE(
'Table',
'Table'[Project],
"Flag",
var _project = [Project]
return
IF(
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Project]=_project
)
)=
COUNTROWS(
FILTER(
ALL('Table'),
'Table'[Project]=_project&&
'Table'[Task_Status]=1
)
),1,0
)
)
var _result =
SUMX(
tab,
[Flag]
)
return
IF(
ISBLANK(_result),
0,
_result
)
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.
@Anonymous , Try
countx(filter(summarize(table, table[project],"_1" ,distinctcount(table[sub project]) , "_2" , calculated( distinctcount(table[sub project]),table[sub project Status]) = "Closed"), [_1] =[_2]),[project])
@amitchandak Thanks for the response.
But I'm still not getting the desired output. The result has projects having both completed and pending tasks.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |