Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
4 years ago
Solved

Filtering a chart by the last date

Good morning, I'm trying to filter a line graph by the last date, which provides me with a date range filter. I would like the chart in this case to only appear values for 28/02/2022.

Alberto99_0-1647594721217.png

  • Hi, Syndicate_Admin ;

    Try to create a measure:

    Flag = 
    var _max= CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
    return IF(MAX('Table'[Date])=_max,1,0)

    Then apply it into line chart.

    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.

3 Replies

  • Syndicate_Admin ,

    Create measure like this. or create a measure and use that as visual level filter

     

    measure =

    var _max = maxx(allselected(date), Date[Date])

    return

    calculate(countrows(Table), filter(Date, Date[Date] =_max))

     

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Good, I've tried the formula you put on me and it gives me back an integer, not the maximum date for the range of values.

      On the other hand what you tell me about putting it as a visual filter, what would the configuration be like?

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

    Hi, Syndicate_Admin ;

    Try to create a measure:

    Flag = 
    var _max= CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
    return IF(MAX('Table'[Date])=_max,1,0)

    Then apply it into line chart.

    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.