Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
OKgo
Helper IV
Helper IV

Replace all values in column using a another table to store transformations/translations

Translation Table (All rows are unique). 
The numbers assigned do not have a strong logic. A look up would be required.

Location New_Location

World02 World
Argentina07 Argentina


Data (Many duplicates)

Location Value

World5
World6
Mexico18


I would like to replace the Data[Location] with Translation[New_Location]. If there is no entry in the translation table the orignal entry is acceptable. Within the model a many to one relationship between Data[Location] and Translation[Location] exisits. There is too many values to make replace values feature practical and the translation table is subject to changes.

In Excel, I would have created a VLOOKUP helper column. Then copy and paste-special-values to overwrite the orignal location Data[Location] entries. I am strugling through these fourms and google to find an elgant solution. Thank you very much in advance for your time!
 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @OKgo

 

Try this calculated column in DataTable

 

New Location =
VAR RESULT =
    CALCULATE ( FIRSTNONBLANK ( TranslationTable[New_Location], 1 ) )
RETURN
    IF ( ISBLANK ( RESULT ), 'DataTable'[Location], result )

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

Hi @OKgo

 

Try this calculated column in DataTable

 

New Location =
VAR RESULT =
    CALCULATE ( FIRSTNONBLANK ( TranslationTable[New_Location], 1 ) )
RETURN
    IF ( ISBLANK ( RESULT ), 'DataTable'[Location], result )

Hi Zubair_Muhammad. Thank you so much for replying. Am I using the correct window to use the code? The show error feature highlights the word RESULT.

PBI.png

Yes this is wrong window.

The formula is for a calculated column

Right click the table, select new column and then use this formula

Thank you so much! It works in the report view.

 

I was hoping to be able to see the column within edit queries to check the output but maybe that is not possible.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors