Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to Create Continuous Line Chart at End of Position

I have a line chart which the dark blue line data point ends halfway through the chart, as no future data is yet available. Is there a way to continue the line throughout the rest of the months on t...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    You need create a  calendar table first. Create a relationship between actual table and calendar table depend on date.

    Then create a measure like the following:

    measure =
    VAR _LASTDATE =
        CALCULATE ( MAX ( 'Table'[Date] ), ALLSELECTED ( 'Table' ) )
    VAR _LASTVALUE =
        CALCULATE (
            MAX ( 'Table'[Average Actual FTE] ),
            FILTER ( ALLSELECTED ( 'Table' ), [Date] = _LASTDATE )
        )
    RETURN
        IF (
            ISBLANK ( MAX ( 'Table'[Average Actual FTE] ) ),
            IF ( MONTH ( MAX ( 'CALENDAR'[Date] ) ) >= MONTH ( _LASTDATE ), _LASTVALUE ),
            MAX ( 'Table'[Average Actual FTE] )
        )
    

     

    Result:

     

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.