Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Filter on table with measure not working

Hi,

 

I have two tables Tab1 and Tab2 both containing one column of integer from 1 to 20 000.

 

Goal : user select a first value (Whole Number) from Tab1[col1] with a slicer and then I want an other slicer where the user can select only values between 1 and the selected value in Tab1.

 

I tried to get the selected value thanks to SELECTEDVALUE(Tab1), that is working I can display the choice in a table. 

But to filter Tab2 by doing FILTER(Tab2, Tab2[col2]<[selectedvalue]) it creates me a blanck table.

Whereas if I do  FILTER(Tab2, Tab2[col2]<10) it's working I have only values between 1 and 10 for instance of my Tab2.

 

My measure is a wholenumber.

I have no relationship between Tab1 and Tab2.

 

Thanks for your help,

 

Don't hesitate if I'm not clear,

 

Rob

  • tamerj1's avatar
    tamerj1
    3 years ago

    Anonymous 
    Not sure how you've created the filter but it should be something like:

    FilterMeasure =
    COUNTROWS ( FILTER ( Tab2, Tab2[col2] < [selectedvalue] ) )

    Place it in the filter pane of the 2nd slicer, select "is not blank" the apply the filter.

8 Replies

  • hi Anonymous 

    could you elabroate how do you implement "to filter Tab2 by doing FILTER(Tab2, Tab2[col2]<[selectedvalue]) "?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks FreemanZ for your answer,

       

      Fisrt I have slicer where user can choose a Whole Number from 1 to 20 000 from Tab1[col1].

      Then I have measure, let's note it measure1, such that measure1=SELECTEDVALUE(Tab1[col1]).

      After that I create a table : table2=filter(Tab2, Tab2(col2)<[measure1]). 

      And table2 is a blanck table with this method.

       

      I can precise more if needed. 

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 
    Double check the data type of both columns and confirm both are of intiger data type not text or general.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi tamerj1,

       

      Thanks for you answer,

       

      the data type of both columns is "Whole number"

      • tamerj1's avatar
        tamerj1
        Icon for Community Champion rankCommunity Champion

        Anonymous 
        Not sure how you've created the filter but it should be something like:

        FilterMeasure =
        COUNTROWS ( FILTER ( Tab2, Tab2[col2] < [selectedvalue] ) )

        Place it in the filter pane of the 2nd slicer, select "is not blank" the apply the filter.