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 August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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