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
StoryofData
Helper III
Helper III

DAX with Multiple Conditions

How do I write out a measure that would concatenate two columns based on the following conditions:

If Employee ID is blank then result should always be blank 

If Employee ID is filled in but City OR State Contains Not Applicable OR Not Disclosed then also blank

If all columns are filled in, concatenate Case # & Employee ID

 

StoryofData_1-1676577394903.png

 

 

1 ACCEPTED SOLUTION
marcelsmaglhaes
Super User
Super User

Hey @StoryofData !


Try the DAX bellow, and if it helps, please mark as solved. Thanks!

 

new_column =
SWITCH (
TRUE (),
[Employee_ID] = BLANK (), BLANK (),
[Employee_ID] <> BLANK ()
&& CONTAINS ( YOUR_TABLE, [CITY], "NOT APPLICABLE", [STATE], "NOT APPLICABLE" )
= TRUE ()
|| CONTAINS ( YOUR_TABLE, [CITY], "NOT DISCLOSED", [STATE], "NOT DISCLOSE" )
= TRUE (), BLANK (),
COMBINEVALUES ( "-", [CASE], [EMPLOYEE ID] )
)


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



View solution in original post

2 REPLIES 2
StoryofData
Helper III
Helper III

Thank you so so much! I went down few different avenues but did not try swith

marcelsmaglhaes
Super User
Super User

Hey @StoryofData !


Try the DAX bellow, and if it helps, please mark as solved. Thanks!

 

new_column =
SWITCH (
TRUE (),
[Employee_ID] = BLANK (), BLANK (),
[Employee_ID] <> BLANK ()
&& CONTAINS ( YOUR_TABLE, [CITY], "NOT APPLICABLE", [STATE], "NOT APPLICABLE" )
= TRUE ()
|| CONTAINS ( YOUR_TABLE, [CITY], "NOT DISCLOSED", [STATE], "NOT DISCLOSE" )
= TRUE (), BLANK (),
COMBINEVALUES ( "-", [CASE], [EMPLOYEE ID] )
)


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



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.

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.