Forum Discussion
Lookup Value From Within Virtual Table
- 7 months ago
Hi diablo9081
You could perform a lookup-equivalent with an expression like this:
SELECTCOLUMNS ( FILTER ( __DataTransformT0, [v_Clinic_Decode] = "<LOOKUP_VALUE>" ), [ClusterId] )Assuming
__DataTransformT0is guaranteed to contain at most one row perv_Clinic_Decode(which should be the case here), this would return a 1x1 table (orBLANK) which is automatically converted to a scalar value where required.Alternatively, you could consider using
DEFINE TABLErather thanDEFINE VARfor__DataTransformT0which would create a table for the duration of the query. You could then reference this table as though it were a model table in an expression like this:LOOKUPVALUE ( __DataTransformT0[ClusterId], __DataTransformT0[v_Clinic_Decode], "<LOOKUP_VALUE>" ) )See here.
Hi diablo9081
Thank you for reaching out to the Microsoft Fabric Forum Community.
OwenAuger Thanks for the inputs.
I hope the information provided by users was helpful. If you still have questions, please don't hesitate to reach out to the community.