Forum Discussion
Comparing 2 rows in a table based on a matching data
- Anonymous4 years ago
Hi andy919 ,
I think you table should look like as below.
Then create a table with column name 4 and 5. We need it to create a slicer.
Column Name = {"Column4","Column5"}Measure:
Compare = VAR _SELECTVALUE = SELECTEDVALUE ( 'Column Name'[Column Name] ) VAR _VALUE_COLUMN4 = CALCULATE ( MAX ( 'Table'[Column4] ), FILTER ( ALL ( 'Table' ), 'Table'[Compare Row ID] = MAX ( 'Table'[Row ID] ) ) ) VAR _VALUE_COLUMN5 = CALCULATE ( MAX ( 'Table'[Column5] ), FILTER ( ALL ( 'Table' ), 'Table'[Compare Row ID] = MAX ( 'Table'[Row ID] ) ) ) RETURN SWITCH ( _SELECTVALUE, "Column4", IF ( MAX ( 'Table'[Column4] ) = _VALUE_COLUMN4, "Fail", "Pass" ), "Column5", IF ( MAX ( 'Table'[Column5] ) = _VALUE_COLUMN5, "Fail", "Pass" ) )Result is as below.
Select Column4:
Select Column5:
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi andy919 ,
I think you table should look like as below.
Then create a table with column name 4 and 5. We need it to create a slicer.
Column Name = {"Column4","Column5"}
Measure:
Compare =
VAR _SELECTVALUE =
SELECTEDVALUE ( 'Column Name'[Column Name] )
VAR _VALUE_COLUMN4 =
CALCULATE (
MAX ( 'Table'[Column4] ),
FILTER ( ALL ( 'Table' ), 'Table'[Compare Row ID] = MAX ( 'Table'[Row ID] ) )
)
VAR _VALUE_COLUMN5 =
CALCULATE (
MAX ( 'Table'[Column5] ),
FILTER ( ALL ( 'Table' ), 'Table'[Compare Row ID] = MAX ( 'Table'[Row ID] ) )
)
RETURN
SWITCH (
_SELECTVALUE,
"Column4", IF ( MAX ( 'Table'[Column4] ) = _VALUE_COLUMN4, "Fail", "Pass" ),
"Column5", IF ( MAX ( 'Table'[Column5] ) = _VALUE_COLUMN5, "Fail", "Pass" )
)
Result is as below.
Select Column4:
Select Column5:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Rico,
Thank you. That was great help. I was able to apply this to my data which has a few thousand rows and multiple columns to compare.
Is there a way for me to filter or export the "Fails' into another table or list?
Regards,
Andy