Forum Discussion
Anonymous
4 years agoNot applicable
Help with Vlookup using same column for search value and column value
Hi everyone, I cant get my head around this problem in Power BI. I´m adding a new column to my table and want to check lookup if the same ID has value in both the column "F" and "L", but on diffe...
- 4 years ago
Anonymous
Please try
= IF ( TableName[ID] IN VALUES ( TableName[L] ) && TableName[ID] IN VALUES ( TableName[F] ), 1, 0 ) - 4 years ago
Anonymous
Please use= VAR CurrentIDTable = CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[ID] ) ) VAR FValue = SUMX ( CurrentIDTable, TableName[F] ) VAR LValue = SUMX ( CurrentIDTable, TableName[L] ) RETURN IF ( FValue > 0 && LValue > 0, 1, 0 )
tamerj1
Community Champion
4 years agoAnonymous
Try either
=
IF (
TableName[ID]
& ""
IN VALUES ( TableName[L] )
&& TableName[ID] IN VALUES ( TableName[F] ),
1,
0
)OR
=
IF (
VALUE ( TableName[ID] )
IN VALUES ( TableName[L] )
&& TableName[ID] IN VALUES ( TableName[F] ),
1,
0
)Otherwise check for hidden charactors or spaces. Try to clean the column in PQ
Anonymous
4 years agoNot applicable
Hi! I did some testing with sample ID. And the dax is only working when I put ID as 1 and not for example 5 or 1XXXX as some ID contains more than one number.
- tamerj14 years ago
Community Champion
Anonymous
It seems I misunderstood tour requirement. I will modify the formula
- tamerj14 years ago
Community Champion
Anonymous
Please use= VAR CurrentIDTable = CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[ID] ) ) VAR FValue = SUMX ( CurrentIDTable, TableName[F] ) VAR LValue = SUMX ( CurrentIDTable, TableName[L] ) RETURN IF ( FValue > 0 && LValue > 0, 1, 0 ) - Anonymous4 years agoNot applicable
Thank you really appreciated it!