Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Filter Table based on Slicer Selection

 

Hi,

 

I've got a table that I want to filter based on what a Slicer selection returns.

 

The context is that I have a slicer table that looks like this:

MIN VIEWS
100

150

200

250

 

The customer should be able to pick one of the MIN VIEWS through the slicer and be returned a table with only the rows which are over the selected amout of Views.

 

 

My code looks like this:

Filtered Table = CALCULATETABLE('datatable'), FILTER('datatable', 'datatable'[Visits] > SELECTEDVALUE('MIN Views'[MIN VIEWS])  )  )

 

 

The selection works, as you can see below, however the filter won't work (e.g. all rows from the datatable are displayed in the new table.

 

 

 

 

 

 

Thanks in advance,

Leon

  • parry2k's avatar
    parry2k
    7 years ago

    Anonymous add measure as below and in table visual, drop product and this new measure, you will have solution

     

    Views Total = 
    VAR __selectedValue = SELECTEDVALUE( Table2[MinViews] )
    RETURN 
    CALCULATE( 
    SUM( Table3[Views] ), 
    Table3[Views] >= __selectedValue
     )

10 Replies

  • Anonymous you cannot use slicer value in calculatetable, you need to create measure and use that in a table visual to show the data.

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k wrote:

      Anonymousyou cannot use slicer value in calculatetable, you need to create measure and use that in a table visual to show the data.


      Hi Parry,

       

      thanks for your reply.

       

      Unfortunately I do not quite understand what you mean with creating a measure and using that in a table visual.

       

      I just created a Measure that gives me the selected views, and tried using that as a filter instead - it didn't work either. Can you explain a bit more in depth?

       

      Thank you for your help!

       

      Leon

      • parry2k's avatar
        parry2k
        Super User

        Anonymous it will be much easier to provide an answer if you post sample data with expected output.