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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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!:
The Definitive Guide to Power Query (M)

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors