Forum Discussion

erhan_79's avatar
erhan_79
Post Prodigy
4 years ago
Solved

Filtering Dates On a table

Hi There ;

 

İ need your kind supports for to create table B as below , i have a table named "Table A" as below , i want to put a dynamic filtre as below ; 

 

  • For example today 03.01.2022 , system will show me a table which one's delivery date will start after 4 days from today and will include 4 days info , so if i am looking table today , system will show me between 07.01.2022 and 11.01.2022 infos , you can see my original table named "Table A" , and you can see the the table that i would like to create "Table B " which one filtered .

Thanks in advance for your kind supports 

 

 

  • Hi erhan_79 ,

     

    You can create a measure with below code and use it as filter on your table visual:-

    _filter =
    VAR start_date =
        TODAY () + 4
    VAR end_date =
        TODAY () + 8
    RETURN
        IF (
            MAX ( 'Table (2)'[Delivery date] ) >= start_date
                && MAX ( 'Table (2)'[Delivery date] ) <= end_date,
            1,
            0
        )

     

    Thanks,

    Samarth

     

4 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi erhan_79 ,

     

    You can create a measure with below code and use it as filter on your table visual:-

    _filter =
    VAR start_date =
        TODAY () + 4
    VAR end_date =
        TODAY () + 8
    RETURN
        IF (
            MAX ( 'Table (2)'[Delivery date] ) >= start_date
                && MAX ( 'Table (2)'[Delivery date] ) <= end_date,
            1,
            0
        )

     

    Thanks,

    Samarth

     

  • erhan_79 , if you select a date and want to dates more than that then that selected date should come from an independent date table

     

    //Date1 is independent Date table, Date is joined with Table
    new measure =
    var _max = maxx(allselected(Date1),Date1[Date]) +8
    var _min = _max -4
    return
    calculate( sum(Table[Qty]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

     

    Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

    • erhan_79's avatar
      erhan_79
      Post Prodigy

      amitchandak  

      thanks for your reply but , i dont want to calculate a sum , just imagine that in a table visual i show table A , but i want to create another visual table as Table B and i want to show only filtered dates and quantities.