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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
AllanBerces
Post Prodigy
Post Prodigy

IF condition

Hi and good day,

Pls need help on my table to create calculated column or in PQ. What we required is 

-IF the location is Project type then used trade column value
-IF the location is MNT type then used the location value

 

AllanBerces_0-1740619576092.png

DESIRED OUTPUT

AllanBerces_1-1740619627291.png

 

Thank you

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @AllanBerces  - can you add a new column in power query editor steps:

Open Power Query Editor>>Select the table>>Click Add Column > Custom Column.

if [Type] = "Project" then [Trade] else [Location]

Click OK and rename the column to Output.Click Close & Apply.

rajendraongole1_0-1740626109538.png

 

Hope this helps.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @AllanBerces 

 

Try this calculated column:

IF(
    'table'[Location] = "Project", 
    'table'[Trade], 
    'table'[Location]
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
rajendraongole1
Super User
Super User

Hi @AllanBerces  - can you add a new column in power query editor steps:

Open Power Query Editor>>Select the table>>Click Add Column > Custom Column.

if [Type] = "Project" then [Trade] else [Location]

Click OK and rename the column to Output.Click Close & Apply.

rajendraongole1_0-1740626109538.png

 

Hope this helps.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1 @danextian thank you very much for the reply, all good.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors