+ Reply to Thread
Results 1 to 5 of 5

DAX full syntax for filter

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    774

    DAX full syntax for filter

    Hi,
    This question is also posted on Mr Excel
     
     https://www.mrexcel.com/board/threads/dax-filter-on-two-tables.1204409/#post-5881080
    Could some one explain the full syntax for :


    Simple:=CALCULATE([Total Revenue],
                                                                                'Product'[Color]="Red" , 
                                                                                   Sales[Sales] = 10  )

    I've tried using various combinations of FILTER (ALL , but none that have worked,


    When filtering on just one table I've been able to use

    CALCULATE([Total Revenue],
                                                                                  KEEPFILTERS(
                                                                                       FILTER(ALL('Product'[Color],'Product'[Product]),
                                                                                                          'Product'[Color]= "Red" && 'Product'[Product]= "A")))
    But this doesn't work for two tables. Any suggestions?


    Richard.
    Last edited by Dicken; 05-09-2022 at 09:37 AM. Reason: Modera

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: DAX full syntax for filter

    What is your table relationship?

    In general you need two FILTER for two table filtering. Alternately, you may be able to use Calculate() as 2nd condition to supply filter context.
    Ex:

    Formula: copy to clipboard
    =CALCULATE([Total Revenue], FILTER('Product','Product'[Color]="Red"), FILTER(Sales, Sales[Sales]=10))
    "Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
    ― Robert A. Heinlein

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,656

    Re: DAX full syntax for filter

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    774

    Re: DAX full syntax for filter

    Sorry, as I didn't get any answers I'd marked it as solved, so did'nt thing a link was requred. I can add one.

    Richard.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,656

    Re: DAX full syntax for filter

    Richard - please read the rules. You MUST add a link before anyone can help you further. Thanks.

+ 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. Replies: 0
    Last Post: 10-27-2021, 04:04 AM
  2. [SOLVED] Facing problem in finding Syntax for Advanced auto filter with wildcards using Macros
    By girishankar09 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2021, 10:44 PM
  3. Syntax for filldown based on another rows length and specific filter
    By TheN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2016, 11:23 AM
  4. [SOLVED] conversion of full and partial date into full format
    By sarat47 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2014, 03:43 PM
  5. Cannot create PT that avoids 255 char limit and has full filter functionality
    By Cortes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 02:58 AM
  6. How to show full totals in Pivot chart and table when you filter on one customer?
    By newbieexcelgirl in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-12-2012, 06:30 PM
  7. Basic question....syntax on active cells from a filter
    By Rominall in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-16-2006, 06:20 PM

Tags for this Thread

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