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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors