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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
elainepowell
Frequent Visitor

Power BI Replace if multiple conditions

There's duplicate AD data that I need usable.

 

If there's a specific city name and it's within TX district, I want to add TX to it.

This requires checking for the city name from one column and checking for TX in the district column.

 

Table.ReplaceValue(
#"previous",
each [AD.physicalDeliveryOfficeName],
each if [AD.physicalDeliveryOfficeName] = "City" and {"AD-person.district"} = "TX"
then "City TX"
else [AD.physicalDeliveryOfficeName],
Replacer.ReplaceText, {"AD.physicalDeliveryOfficeName"}
)

 

It's not working.

Anyone know how I can fix this?

1 ACCEPTED SOLUTION
elainepowell
Frequent Visitor

It looks like it was a glitch with the name of the second column.

On a whim, I renamed the column and now the replace works.

View solution in original post

3 REPLIES 3
elainepowell
Frequent Visitor

It looks like it was a glitch with the name of the second column.

On a whim, I renamed the column and now the replace works.

Greg_Deckler
Super User
Super User

@elainepowell Any chance you can paste some sample data as text?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

The dataset is awkward, but maybe this will work?

AD.physicalDeliveryOfficeNameAD-person.district
Lake StevensWA
College StationTX
LoganUT
MurrayUT
KirklandWA
CityTX
CityOR
BellinghamWA
LancasterCA
StocktonCA
Santa RosaCA
Van NuysCA
PompanoFL
KendallFL
EverettWA
AlbuquerqueNM
El CentroNM
CityTX
CityOR
VisaliaCA
ClovisCA
NovatoCA
MercedCA
San FranciscoCA
LivermoreCA
Miami LakesFL
N MiamiFL
Staten IslandNY
BrooklynNY
YonkersNY
Port ChesterNY
Boca RatonFL
Auburn HillsMI

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors