Dynamic DAX Filter Value

  • Dynamic DAX Filter Value

    Posted by sam-duval on October 29, 2019 at 1:19 pm
    • Sam Duval

      Member

      October 29, 2019 at 1:19 PM

      I’m trying to figure out a way for the value to be user assignable from within the power BI slicer. Basically i’m trying to build a table of people that I want to remove from the report. I can’t do this via normal slicer behavior because they would still be in the report if they have one of the other values that are still checked in the slicer. So i’m trying to create a filtered copy of the main table that has everyone that has a selected product, so I can remove them in later steps. I have the latter process working, just trying to figure out how to dynamically set the filter condition.

      Here is my filter formula that works when the product is hard coded:

      ALM_Exclusion_Table = FILTER(Members_Details,Members_Details[Alternate_ALM]=”Auto Loans-Indirect”)

      I need a way to dynamically pass the “Auto Loans-Indirect” based on the value chosen in a slicer in the report.

      Tired this but it doesn’t work:

      ALM_Exclusion_Table = FILTER(Members_Details,SELECTEDVALUE(ALM_List[Alternate_ALM])=Members_Details[Alternate_ALM])

      I have the selectedvalue working as a measure, but haven’t been able to reference it’s value successfully yet…Ā 
      Measure is:

      Selected_ALM = SELECTEDVALUE(ALM_List[Alternate_ALM])

      This is the filter i tried but didn’t work:

      ALM_Exclusion_Table = FILTER(Members_Details,Members_Details[Alternate_ALM]=Members_Details[Selected_ALM])

      Thanks!

      ——————————
      Sam Duval
      Data Quality Analyst
      Indianapolis
      ——————————

    • Steven Doherty

      Member

      October 30, 2019 at 2:24 AM

      Hi Sam,
      I’m not really sure whether this helps or not, I’ve attached a model using Northwind data which uses a technique that dynamically tests (in this case customers) for a condition (Sales or absence of sales). You then use a slicer to display which customers you want details on… ie those with sales or those without sales. I’ve only used one condition here but you can layer the test conditions with more levels if required.

      Hope this helps.

      ——————————
      Steven Doherty
      Director
      Market Grunt
      Melbourne VI
      0418192168
      ——————————
      ——————————————-

    • Sam Duval

      Member

      October 30, 2019 at 6:42 AM

      Thanks I’ll give this a look and see what I can do with it.?

      ——————————
      Sam Duval
      Data Quality Analyst
      Indianapolis
      ——————————
      ——————————————-

    • Sam Duval

      Member

      October 30, 2019 at 11:24 AM

      Interesting use of DAX filters, i’m going to have to play with this a little more and see how it works. But at first glance, it doesn’t look like it will solve my problem unless you can help explain what i’m looking at.Ā  It looks like you have a table of customers and are counting their sales, then you have a binary yes no to include exclude. Would this process work if Seven Seas Import was in the table twice with a yes and a no value?Ā 

      The gist of what I am doing is mapping where our customers are concentrated around the country. We are a Credit Union, so a single customer can have multiple products with us, but all are required to have a savings account. I’ve been asked to add a drop down to the report where the person viewing the report can exclude people who have a given product category with us. using the exclude function works great but only if the right table is prefiltered to have only the members with the selected product. This is where I’m stuck. I’ll try your hasrows and see if that works. other than that is there any other way to return the filtered results of a table instead of the results that imported during the last refresh?

      ——————————
      Sam Duval
      Data Quality Analyst
      Indianapolis
      ——————————
      ——————————————-

    • Steven Doherty

      Member

      October 30, 2019 at 8:03 PM

      Hi , I’ve adjusted the model so the user selects categories to show those customers that have not purchased them. So, this may be similar to what your users wish to do ie. select customers that haven’t purchased a product type.

      I hope this gets you closer to what you are looking for.?

      ——————————
      Steven Doherty
      Director
      Market Grunt
      Melbourne VI
      0418192168
      ——————————
      ——————————————-

    sam-duval replied 5 years, 10 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Dynamic DAX Filter Value’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!