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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.