Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Filter a column(X) values based on another column(Y) which is a slicer

Here is the question :
If you select Year = 2018, all the data with Year=2018 will get filtered(yellow highlighted data), But I want the data which is present on right side as my output. 

According to me we need to have one measure which will compare 2018 with values in "Plan year" and gives output.

DAX should be something like this:

   

 Result = calculate(sum(Sales), Filter (SELECTEDVALUE(Table[year]) = substring (Table[PlanYear])))

I have sample data as below,

Any help is appreciated.

Thanks!!


  • Anonymous's avatar
    Anonymous
    7 years ago

    Thanks v-lili6-msft for your efforts,

    The one you posted should also work and meanwhile I have found other way as well. 

    For that you need to

     

    1. create calculated column 

    2.

    Planned_year_month_filtered = CONTAINSSTRINGEXACT('Plan Variance'[Planned_year_month],'Plan Variance'[Year])

    3. Then drag the column under visual level filter and set it to "True"

    The desired output is displayed!! :smileyhappy:

     

    But CONTAINSSTRINGEXACT is present in March 2019 release only.

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks v-lili6-msft for your efforts,

      The one you posted should also work and meanwhile I have found other way as well. 

      For that you need to

       

      1. create calculated column 

      2.

      Planned_year_month_filtered = CONTAINSSTRINGEXACT('Plan Variance'[Planned_year_month],'Plan Variance'[Year])

      3. Then drag the column under visual level filter and set it to "True"

      The desired output is displayed!! :smileyhappy:

       

      But CONTAINSSTRINGEXACT is present in March 2019 release only.

      • v-lili6-msft's avatar
        v-lili6-msft
        Icon for Community Support rankCommunity Support

        hi, Anonymous 

        It's pleasant that your problem has been solved, could you please mark the reply as Answered?

         

        Best Regards,

        Lin