Forum Discussion

TDang's avatar
TDang
New Member
4 years ago
Solved

Dynamically Return Data Less Than or Equal To Selected Year

I'm new to Power BI.  I need to have a dropdown of the Year list.  When the value is selected, I need to return the data that is less than or equal to the selected year. TIA.
  • amitchandak's avatar
    4 years ago

    TDang , You can create a measure like

     

    calculate(sum(Table[Value]), filter(all(Table[Year]), Table[Year] <= selectedvalue(Table[Year]) ) )

     

    You can use this as a measure or visual level filter.

     

    But this will not allow you to display a trend; for that year should come from an independent table

     

    calculate(sum(Table[Value]), filter((Table[Year]), Table[Year] <= selectedvalue(year[Year]) ) )

     

    refer

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