Forum Discussion
prj102
6 years agoHelper I
Calculated column based on multiple rows and checking results.
I'm looking for a calculated column function that will help me determine an overall status based on multiple rows of data. My data looks something like this and I am looking to create the "Calcula...
- 6 years ago
You may try the DAX below.
Column = SWITCH ( TRUE (), ISEMPTY ( FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[Name] ) && 'Table'[Status] <> "Passed" ) ), "Passed", NOT ( ISEMPTY ( FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[Name] ) && 'Table'[Status] = "Failed" ) ) ), "Failed", NOT ( ISEMPTY ( FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[Name] ) && 'Table'[Status] = "Warning" ) ) ), "Warning" )
prj102
6 years agoHelper I
I see that your solution is working on the sample data and I even recreated it working myself but its not working on our production data. Can't explain why at this point... In the real data, every row is reporting Passed so I can only assume its defaulting to that. More to come
v-chuncz-msft
6 years agoCommunity Support
You may try the DAX below.
Column =
SWITCH (
TRUE (),
ISEMPTY (
FILTER (
'Table',
'Table'[Name] = EARLIER ( 'Table'[Name] )
&& 'Table'[Status] <> "Passed"
)
), "Passed",
NOT (
ISEMPTY (
FILTER (
'Table',
'Table'[Name] = EARLIER ( 'Table'[Name] )
&& 'Table'[Status] = "Failed"
)
)
), "Failed",
NOT (
ISEMPTY (
FILTER (
'Table',
'Table'[Name] = EARLIER ( 'Table'[Name] )
&& 'Table'[Status] = "Warning"
)
)
), "Warning"
)