cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills 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?


@ 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!:
Mastering Power BI 2nd Edition

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors