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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
MichelleQLi
Regular Visitor

If function or switch function to replace value

I have a table looking like below screenshot. 

I am not that familiar with Power BI DAX syntax, May I get some help to achieve below outcome:

 

A new colume to have:

 

if column 1 equals to "I"

and if Table3.Column6  not null

 

then use Table3.Column6 value to replace Column6 value

else remain Column6 value

 

MichelleQLi_0-1670972726607.png

 

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @MichelleQLi ,

 

For simple conditional columns you can use the Add Conditional Column feature in the Query Editor. By the way, this editor uses M as the language. DAX is used once you've loaded your data into the model.

https://turbofuture.com/computers/A-Comparison-Between-M-Language-and-DAX-in-Power-BI 

danextian_0-1670973774462.png

 





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.

View solution in original post

Anonymous
Not applicable

Hi @MichelleQLi ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1672301386764.png

(2) We can create a calculated column.

Column = IF('Table'[Column1]=="I" && 'Table'[Table3.Column6]<>BLANK(),'Table'[Table3.Column6],'Table'[Column6])

(3) Then the result is as follows.

vtangjiemsft_1-1672301519127.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @MichelleQLi ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

vtangjiemsft_0-1672301386764.png

(2) We can create a calculated column.

Column = IF('Table'[Column1]=="I" && 'Table'[Table3.Column6]<>BLANK(),'Table'[Table3.Column6],'Table'[Column6])

(3) Then the result is as follows.

vtangjiemsft_1-1672301519127.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

danextian
Super User
Super User

Hi @MichelleQLi ,

 

For simple conditional columns you can use the Add Conditional Column feature in the Query Editor. By the way, this editor uses M as the language. DAX is used once you've loaded your data into the model.

https://turbofuture.com/computers/A-Comparison-Between-M-Language-and-DAX-in-Power-BI 

danextian_0-1670973774462.png

 





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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.