Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Problem with filters

Hello, I have a problem with a filter in a calendar table and I am not being able to figure out what I am doing wrong. The issue seems simple, but the filter expression that I am using doesn´t work the way I want. All the information is in the same table.

When I click on the month number on the slicer I want the measure to show de last date of the month selected. In the case of the picture below it should show 31/05/2020 for all Month_year lines and not 31/12/2020.

 

I appreciate the help.

 

Thanks!! 

 

 

  • DavisBI's avatar
    DavisBI
    5 years ago

    Hi, Anonymous ,

     

     If you look at the screenshots I provided, your requirements have been met. But I may need to add that slicers are not related to the main table, you can test it again.

     

    Best!

     

    Mark this post as solution if this helps,thanks!

8 Replies

  • DavisBI's avatar
    DavisBI
    Icon for Solution Specialist rankSolution Specialist

    Hi, Anonymous ,

    In this case you can use selectedvalue() . The following is for your reference:

     

    Measure = EOMONTH(DATE(<year>,SELECTEDVALUE('Table'[Value]),1),0)

     

     

    Mark this post as solution if this helps,thanks!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous  You can use this below formula 

    calculate (EOMONTH([calenderio date], Selectedvalue(month))

    Thank you 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello;

    Thanks for your help DavisBI and Anonymous , but I still can´t get it to work.

    I need the table to show the last day of the selected month for all the dates, in the case below it should show 31/07/2020 for all the Month_year (mm/aa) lines and it is showing the last day of each month_year.

     
     

  • Anonymous's avatar
    Anonymous
    Not applicable
    Which table does the Month selection come from? Certainly it does not come from dCalendario. If that were the case, you wouldn't see all those Month_year (mm/aa) values in the table. If you set it all up in such a way that the Month slicer does NOT affect what you see in the table, then there is no way to get what you want. What you have to do is have a second independent table from which you'll be selecting the reference year and month. Then you'll be able to extract the ref year and month for all the entries in the table and create the date you want. No other way around this.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Anonymous, all the information comes from the same calendar table (dcalendario). It is showing all the Month_year because the interaction between the slice and the table is inactive. I need to show the Month_year.
      I didn´t think about creating a second table, it is a good way around. I am going to try and will let you know if works.

      Thanks for the insights!! 

       

      • Anonymous's avatar
        Anonymous
        Not applicable
        So you don't have much choice but to have another, disconnected table that will host your years and months from which you'll be able to select your ref pieces of time. And it's not a workaround. It's the ONLY and in fact the only correct way to do what you want.