Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Display data in table visual for year slicer selection ,be present betw start & end date

There is a year slicer in report and on table visual
Year filter is coming from cal table having year from 2015 to 2021
Table visual is having column from resources table (name , id , start date, end date)

When i select the year slicer the table visual should display only those resources for which the selected year is between start date and end date.
eg, if user select 2016 then the table visual should display resources from start date 2015 to 2016
can someone help me how we can show this

  • Anonymous , Assume year is coming from the independent table

     

    Create a measure and use with other columns

     

    calculate(count(Table[ID]), filter(Table, year([Start Date]) <= selectedvalue(year[year]) && year([End Date]) >= selectedvalue(year[year]) ))

3 Replies

  • Anonymous , Assume year is coming from the independent table

     

    Create a measure and use with other columns

     

    calculate(count(Table[ID]), filter(Table, year([Start Date]) <= selectedvalue(year[year]) && year([End Date]) >= selectedvalue(year[year]) ))

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

    Hi, Anonymous ;

    You could create a flag measure , then apply it into filter.

    flag = IF(YEAR(MAX([start date]))<=YEAR(MAX('Date'[Date])),1,0)

    Then apply it into filter.

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      As per my understanding this solution will only work for start date and not end date. Below solution suggested by Amit is correct.

      Thank you very much for your response.