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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Need help with DAX

Hello All I am trying to create the below dax which would replace few texts with my desired output as below:

vashu123_0-1670232298235.png

I am facing an error like above. Is there any way we could solve this or any other workaround?Any help would be much appreciated. Thanks in Advance!

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

I'm so glad to hear that your dax problem has been solved. 

 

In order to help you solve problems more efficiently, if you have problems about excle formula, you can reopen a thread or ask questions on excel community.

 

Thanks for your understanding.

 

Best regards,

Yadong Fang

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

amitchandak
Super User
Super User

@Anonymous , Try like

 

Column = SWITCH( True() ,
CONTAINSSTRING(inbound_inventory_test,inbound_inventory_test[ETS_Mgmt_Follow_up_Comments], "ITW"),"Inbound",
CONTAINSSTRING(inbound_inventory_test,inbound_inventory_test[ETS_Mgmt_Follow_up_Comments], "DTW"), "Delivered to WH",
CONTAINSSTRING(inbound_inventory_test,inbound_inventory_test[PO_Confirmation_Date], " "), "not confirmed",
CONTAINSSTRING(inbound_inventory_test,inbound_inventory_test[manufacturer_name], "zones"), "Zones Service",
(inbound_inventory_test[PO_Confirmation_Date])>TODAY()-3, "New PO",
(inbound_inventory_test[PO_Confirmation_Date])<TODAY()-30,"30+days Open",
"Inbound")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak there was a tiny modification below for the dax but it worked out.

Column2 = SWITCH( True() ,
CONTAINSSTRING(inbound_inventory_test[ETS_Mgmt_Follow_up_Comments],"ITW"),"Inbound",
CONTAINSSTRING(inbound_inventory_test[ETS_Mgmt_Follow_up_Comments], "DTW"), "Delivered to WH",
contains(inbound_inventory_test,inbound_inventory_test[PO_Confirmation_Date]," "), "not confirmed",
CONTAINSSTRING(inbound_inventory_test[manufacturer_name], "zones"), "Zones Service",
value(inbound_inventory_test[PO_Confirmation_Date])>TODAY()-3, "New PO",
value(inbound_inventory_test[PO_Confirmation_Date])<TODAY()-30,"30+days Open",
"Inbound")

 

 

I also have one doubt I am generating this using excel formula. In the excel formula they are using OR function on the 3rd line of the dax of you have provided. Below I am pasting the excel formula how can we achieve or function just like the excel formula?

=IF(A7="","",
IF(SUMPRODUCT(--ISNUMBER(SEARCH({"ITW"},L7)))>0,"inbound",
IF(SUMPRODUCT(--ISNUMBER(SEARCH({"DTW"},L7)))>0,"delivered to WH",
IF(N7="(blank)","not confirmed",
IF(OR(T7=1,T7=2),
IF(SUMPRODUCT(--ISNUMBER(SEARCH({"zones"},K7)))>0,"Zones Service",
IF(N7>TODAY()-3,"new PO",
IF(N7<TODAY()-30,"30+days open","inbound"))),
"inbound")))))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.