Forum Discussion

Hugo999's avatar
Hugo999
Frequent Visitor
1 year ago
Solved

Show only last value in line chart?

Dears I've created a line chart in Power BI. How can I display the value of the last data point? I only want to see the value of the last data point, all other data point labels should not be shown....
  • TomasAndersson's avatar
    1 year ago

    Hi!

    I don't know how your data is structured so you have to adjust accordingly, but basically you want to figure out the max date where there is a value and then return blank() for all values that aren't the last point.

     

    LastValueLabel = 
    VAR __LastDate = 
    CALCULATE(MAX('Dates'[Date]), ALL('Dates'))
    RETURN
    IF(
        SELECTEDVALUE('Dates'[Date]) = __LastDate,
        [YourMainMeasure],
        BLANK()
    )

     

    And then add that measure as the Value on the Data Label for your series.

     

    Good luck!