Forum Discussion

LuckyeLies's avatar
LuckyeLies
Regular Visitor
5 years ago
Solved

Choose specific dates based on filters

Hello guys, 

 

Need your help on doing something that I can't understand how to do it, already tried 1001 things but nothing works.

 

Well, I need to do something relatively easy on theory... I need the following:
A filter of dates, and a table who is changed based on that filter and shows the date selected - 1, date selected - 2, date selected - 8 and date selected - 365, well, you got it, doesn't matter what's the dates, by I need some dates that is changed according to that filter. Well, What I've done so far is a table with the dates I want , but without the filters, I created a new column with a flag on that dates, and then filter that table based on that flag, and then i get all the dates I want, but ofc, that doesn't work with a filter of dates.

 

I can't do anything on table cause it is static and doesn't change based on filters ofc and I can't do a measure cause it only returns a single value, I think that the only way to do it is using parameters but don't know exactly how...

 

Can someone help me please ? 

 

Thank you in regards,

  • Hi LuckyeLies 

     

    If I understand it correctly, you want to select a date in a slicer or a filter, then in a table it will show data in the previous 365 days of the selected date dynamically, right?

     

    If so, you need to have an independent date table in the model to contain all dates to be selected in the filter. This table is not connected to any other table in the model. Then create a flag measure to determine whether a date in the fact table (or another date table which is connected to fact table in the model) are in the previous 365 days of the selected date. Put date column from fact table into a table visual and put flag measure into the visual as a filter. 

     

    Here is a sample for your reference. It shows the previous 10 days of a selected date.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

     

     

3 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi LuckyeLies 

     

    If I understand it correctly, you want to select a date in a slicer or a filter, then in a table it will show data in the previous 365 days of the selected date dynamically, right?

     

    If so, you need to have an independent date table in the model to contain all dates to be selected in the filter. This table is not connected to any other table in the model. Then create a flag measure to determine whether a date in the fact table (or another date table which is connected to fact table in the model) are in the previous 365 days of the selected date. Put date column from fact table into a table visual and put flag measure into the visual as a filter. 

     

    Here is a sample for your reference. It shows the previous 10 days of a selected date.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

     

     

    • LuckyeLies's avatar
      LuckyeLies
      Regular Visitor

      Thank you man, that's exactly what I needed, problem solved ;D