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
22LACMT
Helper III
Helper III

If dax with columns

Hi Im trying to write the below if statement.  the if funtion wants the 2 columns to be measures.  so I used the selecedvalue to turn the columns into measures. but I am getting the error: do not surrport compairing values of type text with values of type 
 
 
 
DAX:   SFFandCCRC_indicator =
var blue = SELECTEDVALUE(ProviderInfo[SFF])
var green = SELECTEDVALUE(PIPastMonth1[Special Focus Status])
return if(OR(blue =  or("SFF", "SFF Candidate"), (green = or("SFF", "SFF Candidate"))), "True", "False")
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @22LACMT ,

 

As far as I know,"||" should be OR function in Dax. Grey's code should work and please check your data model.

vrzhoumsft_0-1697608062316.png

Also you can update your code as below.

SFFandCCRC_indicator = 
VAR blue =
    SELECTEDVALUE ( ProviderInfo[SFF] )
VAR green =
    SELECTEDVALUE ( PIPastMonth1[Special Focus Status] )
RETURN
    IF (
        OR ( blue IN { "SFF", "SFF Candidate" }, green IN { "SFF", "SFF Candidate" } ),
        "True",
        "False"
    )

You can download my sample file to learn more details.

 

Best Regards,
Rico Zhou

 

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

5 REPLIES 5
22LACMT
Helper III
Helper III

Im missing something there should be 12 records and there are none marked as true

 

Greg_Deckler
Community Champion
Community Champion

@22LACMT I *think* you want this:

var blue = SELECTEDVALUE(ProviderInfo[SFF])
var green = SELECTEDVALUE(PIPastMonth1[Special Focus Status])
return 
  if( blue = "SFF" || blue = "SFF Candidate" || green = "SFF" || green = "SFF Candidate", "True", "False")


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi, 

everything is showing as false and their should be 12 true.  do you think it is the selected value. 

Anonymous
Not applicable

Hi @22LACMT ,

 

As far as I know,"||" should be OR function in Dax. Grey's code should work and please check your data model.

vrzhoumsft_0-1697608062316.png

Also you can update your code as below.

SFFandCCRC_indicator = 
VAR blue =
    SELECTEDVALUE ( ProviderInfo[SFF] )
VAR green =
    SELECTEDVALUE ( PIPastMonth1[Special Focus Status] )
RETURN
    IF (
        OR ( blue IN { "SFF", "SFF Candidate" }, green IN { "SFF", "SFF Candidate" } ),
        "True",
        "False"
    )

You can download my sample file to learn more details.

 

Best Regards,
Rico Zhou

 

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

 

thank you, can I ask what || mean

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.