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 all
I have the following two tables:
Jobs
JobID Status
1 Complete
2 Complete
3 Open
4 Open
Tasks
JobID Task Status
1 T1 Complete
1 T2 Complete
1 T3 Open
2 T1 Complete
2 T2 Complete
3 T1 Open
3 T2 Open
4 T1 Open
4 T2 Complete
I want to create a calculated column (NewStatus) in the Jobs table, as follows:
IF Jobs[Status]="Complete" AND ALL RELATED Tasks[Status]="Complete" then "Complete"
ELSE IF Jobs[Status]="Complete" AND ALL RELATED Tasks[Status]<>"Complete" then "Labour Complete"
ELSE "Open"
So if I add the Jobs table to the report canvas as a table visual then I would get:
JobID Status NewStatus
1 Complete Labour Complete
2 Complete Complete
3 Open Open
4 Open Open
Any ideas how I can create this calculated column?
Many thanks for all help
Solved! Go to Solution.
Try this
= VAR Condition1 = COUNTROWS ( RELATEDTABLE ( Tasks ) ) VAR Condition2 = CALCULATE ( COUNTROWS ( RELATEDTABLE ( Tasks ) ), Tasks[Status] = "Complete" ) RETURN SWITCH ( TRUE (), AND ( [Status] = "Complete", Condition1 = Condition2 ), "Complete", AND ( [Status] = "Complete", Condition1 <> Condition2 ), "Labour Complete", "Open" )
Try this
= VAR Condition1 = COUNTROWS ( RELATEDTABLE ( Tasks ) ) VAR Condition2 = CALCULATE ( COUNTROWS ( RELATEDTABLE ( Tasks ) ), Tasks[Status] = "Complete" ) RETURN SWITCH ( TRUE (), AND ( [Status] = "Complete", Condition1 = Condition2 ), "Complete", AND ( [Status] = "Complete", Condition1 <> Condition2 ), "Labour Complete", "Open" )
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |