Forum Discussion

sivareddy123's avatar
sivareddy123
Microsoft Employee
7 years ago
Solved

like statement in dax

Hi,

 

Can you please guide me how to write below sql query in dax ?

 

SELECT sum(revenueamount) from MsSales
where premiersupportmodel in('unifed') and (familyname like '%base%' or familyname like '%add%') 

 

Thanks,

Siva Reddy

  • Hi sivareddy123 ,

     

    Try this one, If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

     

    =
    CALCULATE (
        SUM ( MsSales[revenueamount] ),
        FILTER (
            MsSales,
            MsSales[premiersupportmodel] = "unifed"
                && SEARCH ( "%base%", MsSales[familyname], 0, BLANK () ) <> BLANK ()
                || SEARCH ( "%add%", MsSales[familyname], 0, BLANK () ) <> BLANK ()
        )
    )
    

     

2 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi sivareddy123 ,

     

    Try this one, If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

     

    =
    CALCULATE (
        SUM ( MsSales[revenueamount] ),
        FILTER (
            MsSales,
            MsSales[premiersupportmodel] = "unifed"
                && SEARCH ( "%base%", MsSales[familyname], 0, BLANK () ) <> BLANK ()
                || SEARCH ( "%add%", MsSales[familyname], 0, BLANK () ) <> BLANK ()
        )
    )