Forum Discussion
Help with if statement for different values in other columns
- 3 years ago
Hi Anonymous ,
According to your description, here's my solution. Create a measure.
Discrepancy found? = IF ( COUNTROWS ( FILTER ( ALL ( 'Table' ), 'Table'[Location] = MAX ( 'Table'[Location] ) && 'Table'[Name] = MAX ( 'Table'[Name] ) && ( 'Table'[age] <> MAX ( 'Table'[age] ) || 'Table'[income] <> MAX ( 'Table'[income] ) ) ) ) > 0, "Yes", "No" )Get the correct result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous ,
Create a Calculated Column as shown below...
Discrepancy =
IF (
CALCULATE (
COUNT ( 'Table'[income] ),
FILTER (
'Table',
'Table'[Location] = EARLIER ( 'Table'[Location] )
&& 'Table'[Name] = EARLIER ( 'Table'[Name] )
)
) > 1,
IF (
DISTINCTCOUNT ( 'Table'[age] ) > 1
|| DISTINCTCOUNT ( 'Table'[income] ) > 1,
"Y"
),
"N"
)
- Anonymous3 years agoNot applicable
Hi ddpl,
Thanks for submitting this, unfortunately it doesn't work as it doesn't fulfil the requirement of being able to indicate which ones have the same location & name, but different values for income or age.
If it helps, there will only ever be "teen" or "adult" values for age, and with Income it will only be "High", Low" or "N/a"
- ddpl3 years ago
Solution Sage
Anonymous ,
can you share slightly more data with expected result.