+ Reply to Thread
Results 1 to 12 of 12

DAX Keepfilter

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

    DAX Keepfilter

    Hi,

    I've seen an sqlbi vid where it seems to show the use of Keepfilters on two colunmns in the same table . I've not been able to get this to work
    and have always used Filter wrapped in KF . so


    Please Login or Register  to view this content.

    Does not work even though the columns are in the same table but

    Please Login or Register  to view this content.
    Does work, am I missing something as to the first simpler version, in the video is also seems to be used with summarize so I don't know if that makes a difference. Workbook attached any advice or help welcom.

    RD
    Attached Files Attached Files

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: DAX Keepfilter

    What is your issue with the first one? It works fine here - the same as the second.
    Rory

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

    Re: DAX Keepfilter

    I've just downloaded the file i put up and it definitely shows an error for the first,

    I re typed it just to try again and get the same error message from it.

    Please Login or Register  to view this content.

    RD

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: DAX Keepfilter

    What error message? I loaded it into a pivot straight from your file with no changes and it produced the same results as the other measure.

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: DAX Keepfilter

    Just tried it in 2016 which gives an error with the first one, with or without KEEPFILTERS. You need to use FILTER explicitly to use more than one column in the filter predicate.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: DAX Keepfilter

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Calculation error in measure 'Table1'[BandRed]: The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.
    Description and usage of KEEPFILTERS()

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    No errors in formula.
    Last edited by sandy666; 01-04-2023 at 01:47 PM.

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

    Re: DAX Keepfilter

    Sorry for not getting back to you, don't know? I definitely get an error, what I'll do is try in PBI and see if that's the same, I was coming to the conclusion in was a problem my end.

    RD

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: DAX Keepfilter

    I'm assuming it's a version issue, since my 2016 produces an error, but my 365 Insider doesn't. Since the two versions are internally the same, I don't really see the issue?

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

    Re: DAX Keepfilter

    Not according to this
    Please Login or Register  to view this content.
    Wher Product 'color' and Product 'brand' are both used with an 'and' conjunction in the same Keepfilter argument.

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

    Re: DAX Keepfilter

    I'm on 365, it works in PBi, thanks for looking into it, I might put a post on Mr Excel or MS website, see if it's just me or a version issue.
    I'ts not a huge problem as I can get the result using the full Kf ( Fiter ( all , etc. It's just been annoying me.

    Thanks again.

    RD

  11. #11
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,907

    Re: DAX Keepfilter

    It has to be a version issue given my findings and the fact it doesn't work on your 365 build.

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

    Re: DAX Keepfilter

    Yes, I know there are a few things that work in pbi that don't in pp i.e selectedvalue, mind you I find using If Hasonevalue values a bit more descriptive if what's acutely happening.

    RD

+ 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. DAX Two Keepfilter with OR function
    By Dicken in forum Office 365
    Replies: 0
    Last Post: 06-05-2022, 09:21 AM

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