cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sivareddy123 Frequent Visitor
Frequent Visitor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: like statement in dax

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 ()
    )
)

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: like statement in dax

You should be able to use FIND or SEARCH in place of LIKE


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Community Support Team
Community Support Team

Re: like statement in dax

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 ()
    )
)

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)