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
manuelfigueira
Helper II
Helper II

If Condition using SWITCH(TRUE)

Hello Everyone,

 

I'm trying to create a IF condition (Calculated column) but seems my DAX is not working, any idea why PBI says "DAX Comparison Operations do not support comparing values of type integer with values of type Text. "",

 

Is there any other way to use IF functions below?

 

Thanks a lot!

 

 

 

Action = SWITCH(TRUE(),
[Split] = "FOOD", "RELEASE",
[Status] = "Unmatched Standard", AND('SAP'[Age] < "91", "HOLD"),
[Status] = "Unmatched Standard", AND('SAP'[Age] > "90", AND('SAP'[Age] < "181", "TIMING")),
BLANK())
1 ACCEPTED SOLUTION

@manuelfigueira
Maybe you need smth like this. If it doesn’t help, please, share example of your data and desired result in order to help you

Action = SWITCH(
TRUE(),
[Split] = "FOOD", "RELEASE",
And([Status] = "Unmatched Standard", 'SAP'[Age] < 91), "HOLD",
And([Status] = "Unmatched Standard", AND('SAP'[Age] > 90, 'SAP'[Age] < 181)), "TIMING",
BLANK())

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

hi @manuelfigueira 

try without quotas

Action = SWITCH(TRUE(),
[Split] = "FOOD", "RELEASE",
[Status] = "Unmatched Standard", AND('SAP'[Age] < 91, "HOLD"),
[Status] = "Unmatched Standard", AND('SAP'[Age] > 90, AND('SAP'[Age] < 181, "TIMING")),
BLANK())

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi @az38 

 

Thank you very much for the below! I tried, the columns [Age] are Text so the quotas are alright, but I believe is there something related with the function itself, 

 

The original function is this:

 

=IF(SAP[SPLIT]=""FOOD"",""RELEASE"",

  IF(AND(SAP[Status]=""Unmatched Standard"", SAP[Age]<91),""HOLD"",

  IF(AND(SAP[Status]=""Unmatched Standard"",AND(SAP[Age]>90,SAP[Afe]<181)),""TIMING"",""RELEASE"")))"

 

I think part the solution is how do you create a logic chain with the above?

@manuelfigueira
Maybe you need smth like this. If it doesn’t help, please, share example of your data and desired result in order to help you

Action = SWITCH(
TRUE(),
[Split] = "FOOD", "RELEASE",
And([Status] = "Unmatched Standard", 'SAP'[Age] < 91), "HOLD",
And([Status] = "Unmatched Standard", AND('SAP'[Age] > 90, 'SAP'[Age] < 181)), "TIMING",
BLANK())

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 You are a genius! thank you very much for this! 

 

 

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.

Top Solution Authors