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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JamesBurke
Helper III
Helper III

Conditional Column

Hi All , 

 

i'm looking at aking a donitonal column so when building = "Store 1" = 2 

 

Building Conditonal column
Art & Design 1
Humanties 2
Science 3

 

Then i want to create another column that says if Conditonal column one = "2" then use a certain Measure. 

 

Essentially a conditonal column , that says when another conditonal column = a certain value use a specfic measure. 

 

I'm thinknig it would be using the if function but i'm unsure how to write it. 

 

Thanks , James. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JamesBurke ,

 

Thanks for the reply from uzuntasgokberk , please allow me to provide another insight: 

 

You can also choose to use the switch function for this. More details about this function can be found in the documentation: SWITCH function (DAX) - DAX | Microsoft Learn

 

Column = 
SWITCH('Table'[Conditonal column],
1, "A",
2, "B",
3, "C",
"Other")

 

vkaiyuemsft_1-1729130223894.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @JamesBurke ,

 

Have you already solved the problem? If so, can you share your solution here and mark the correct answer as standard to help other members find it faster? Thank you very much for your co-operation!

 

 

Best Regards,

Clara Gong

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

Anonymous
Not applicable

Hi @JamesBurke ,

 

Thanks for the reply from uzuntasgokberk , please allow me to provide another insight: 

 

You can also choose to use the switch function for this. More details about this function can be found in the documentation: SWITCH function (DAX) - DAX | Microsoft Learn

 

Column = 
SWITCH('Table'[Conditonal column],
1, "A",
2, "B",
3, "C",
"Other")

 

vkaiyuemsft_1-1729130223894.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

uzuntasgokberk
Super User
Super User

Hello @JamesBurke,

 

You can write if conditonal on Power Query and Calculated Column(Dax). 

Below the example is example of Power Query if:

if ([C] = "A" or [C] = "B") and [D] = "PASS" then "PASS"
else if [C] = "C" and [D] = "PASS" then "PASS"
else "FAIL"

İf you'd like to write new column(calculated column DAX):

IF(
 table[colname] = 1,
"PASS",
IF(
 table[colname] >1,
"MED",
"FAIL")
)
Also you can use switch function instead of IF. it better performance than "if" in the DAX.

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors