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.
Project Master Task Allocation
ProjectID projectName Project Status Task ID ProjectiD Task status
P1 A T1 P1 Completed
P2 B T2 P1 In progress
P3 C T3 P1 Completed
T4 P2 Inprogress
T5 P2 Completed
T6 P2 In progress
I need to update "Project status" in Project Master in such a way that if any of the task of Project is in progress then we need to update "Project status" as "In progress" othervise "Completed".
Can any one tell me, how to approach this problem.
I tried it with LookupValue(),but is works only for one matching record.But here are multiple matching record.
@Rajat, First, please do not cross-post in every forum, that's not cool. A lot of us use the "All Topics" view and so we see your post four times and have no idea which one to respond to.
Second, try something like this:
IF(COUNTAX(FILTER('Task Allocation'[Task status]='In Progress'),[Task ID]) = 0,"In progress", "Completed)
Status = IF( ISEMPTY( CALCULATETABLE( 'Task Allocation' ,'Task Allocation'[Task Status] = "In Progress" ) ) ,"Completed" ,"In Progress" )
This assumes a relationship between 'Project Master' and 'Task Allocation'.
CALCULATETABLE() will respect the row context of [Project ID] from 'Project Master' and give us the matching rows from 'Task Allocation'. Additionally, we apply a filter to return only rows where 'TaskAllocation'[Task Status] = "In Progress". We test the resulting table with ISEMPTY() which tests what it says. If there are no rows, we know the project is complete. If there are rows with "In Progress", then the project is in progress.
SELECT PM.ProjectID, PM.projectName,
CASE WHEN T.ProjectID IS NULL THEN 'Completed' ELSE 'In progress' END as ProjectStatus
FROM Project_Master PM,
(SELECT distinct ProjectiD
from task_allocation
where Task_status = 'In progress') t
WHERE pm.ProjectID = t.ProjectiD(+)
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 |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |