+ Reply to Thread
Results 1 to 4 of 4

PowerPivot DAX for SEARCH across two text values

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    497

    PowerPivot DAX for SEARCH across two text values

    Hi

    Could someone help me with whether it's possible to do filter by one column using contains two text strings.

    I've tried:
    1) CALCULATE(SUM(columnname,SEARCH(OR("textstring1","textstring2"),columnname,1,0)>0)
    2) CALCULATE(SUM(columnname,SEARCH({"textstring1","textstring2"},columnname,1,0)>0)

    Thanks

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: PowerPivot DAX for SEARCH across two text values

    Try something like:

    Formula: copy to clipboard
     CALCULATE(SUM(columnname),FILTER(tablename,(SEARCH("textstring1",columnname,1,0)>0) || (SEARCH("textstring2",columnname,1,0)>0)))
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    497

    Re: PowerPivot DAX for SEARCH across two text values

    thanks romperstomer

  4. #4
    Forum Contributor
    Join Date
    02-14-2012
    Location
    Warrington
    MS-Off Ver
    Excel 365
    Posts
    497

    Re: PowerPivot DAX for SEARCH across two text values

    Just in case anyone else reads this, this was the correct syntax

    =CALCULATE(SUM(columnname),(SEARCH("textstring1",columnname,1,0)>0) || (SEARCH("textstring2",columnname,1,0)>0))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Search a text for a array of values
    By amith4455 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-03-2023, 12:21 PM
  2. IFERROR - SEARCH - Look for date/text values and return a specified text name
    By chrisbay2324 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-01-2018, 03:26 PM
  3. Replies: 4
    Last Post: 07-23-2015, 03:35 PM
  4. Replies: 2
    Last Post: 06-02-2014, 09:34 AM
  5. Replies: 0
    Last Post: 11-20-2012, 05:34 AM
  6. Search text string for range of text values - return match
    By crugg in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-03-2010, 09:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1