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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

OR DAX Formula with nested Search

Hi Experts

 

I have the following search formula which works fine and returns the correct result, i want to slightly change the formula so to have OR in the current measure

so the end result could be either

IF(SEARCH("compontentdissociation",'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],1,1000)<>1000,18

OR

IF(SEARCH("dissociation",'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],1,1000)<>1000,18

and the out put result as 18.

 

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

By my test, you also could get your desired output without using OR function. Please refer to the formula below.

Column 2 =
IF (
    SEARCH (
        "aaa",
        'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
        1,
        1000
    ) <> 1000,
    18,
    IF (
        SEARCH (
            "bbb",
            'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
            1,
            1000
        ) <> 1000,
        18
    )
)

Here is the output.

Capture.PNG

If you really want to use OR function, you could try this below.

Column =
OR (
    IF (
        SEARCH (
            "aaa",
            'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
            1,
            1000
        ) <> 1000,
        18
    ),
    IF (
        SEARCH (
            "bbb",
            'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
            1,
            1000
        ) <> 1000,
        18
    )
)

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

By my test, you also could get your desired output without using OR function. Please refer to the formula below.

Column 2 =
IF (
    SEARCH (
        "aaa",
        'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
        1,
        1000
    ) <> 1000,
    18,
    IF (
        SEARCH (
            "bbb",
            'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
            1,
            1000
        ) <> 1000,
        18
    )
)

Here is the output.

Capture.PNG

If you really want to use OR function, you could try this below.

Column =
OR (
    IF (
        SEARCH (
            "aaa",
            'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
            1,
            1000
        ) <> 1000,
        18
    ),
    IF (
        SEARCH (
            "bbb",
            'njrew_k_prmry_bicon_outcm'[INDREV_SUMMARYREVISIONREASONS],
            1,
            1000
        ) <> 1000,
        18
    )
)

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

many thanks cheery works prefectly....

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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