Forum Discussion
How to use lookupvalue function for PBI direct query/dual mode
- 6 years ago
Hi, abbynie08
In DirectQuery, calculated columns are limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions. You may create a measure as below,which is the same effect as lookupvalue function.
Measure = //LOOKUPVALUE('Table'[Required_2],'Table'[Role_2],SELECTEDVALUE('Table'[Role])) CALCULATE( VALUES('Table'[Required_2]), FILTER( 'Table', 'Table'[Role_2] = SELECTEDVALUE('Table'[Role]) ) )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, abbynie08
In DirectQuery, calculated columns are limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions. You may create a measure as below,which is the same effect as lookupvalue function.
Measure =
//LOOKUPVALUE('Table'[Required_2],'Table'[Role_2],SELECTEDVALUE('Table'[Role]))
CALCULATE(
VALUES('Table'[Required_2]),
FILTER(
'Table',
'Table'[Role_2] = SELECTEDVALUE('Table'[Role])
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- olimilo1 year ago
Post Prodigy
Is this not possible to do as a calculated column? Especially when there's a need to filter the data