Forum Discussion
Transform Values taken from a Lookup Table
- 8 years ago
HI WALEED
Yes in that case Power Query is the choice
See the attached file here fro Power Query solution
Do you want a calculated column, NEW TABLE, MEASURE?
For example you can add following Calculated Column in Source Table
Revised Field 1 =
LOOKUPVALUE (
LookUpTable[NEW VALUE],
LookUpTable[OLD VALUE], SourceTable[FIELD 1],
LookUpTable[FIELD NAME], "FIELD 1"
)- Zubair_Muhammad8 years agoCommunity Champion
In case you want the Old Value when there is no corresponding NEW value, you can use this
Revised Field 1 = VAR myvalue = LOOKUPVALUE ( LookUpTable[NEW VALUE], LookUpTable[OLD VALUE], SourceTable[FIELD 1], LookUpTable[FIELD NAME], "FIELD 1" ) RETURN IF ( ISBLANK ( myvalue ), SourceTable[FIELD 1], myvalue )- WALEED8 years agoAdvocate II
Many thanks; please allow me to pick your brain a little more:
I'm using Power BI. will this work in Power Query?
Is there a way to identify the field name using the first column of the lookup table?
And finally, replace the original column with the transformed one.
The reason I want it to be dynamic is there are 243 ever-changing fields.
- Zubair_Muhammad8 years agoCommunity Champion
HI WALEED
Yes in that case Power Query is the choice
See the attached file here fro Power Query solution