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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.