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 the date X Axis as a straight line with its current end position?

 

Current table reads 

RoleIDDateActual HoursAverage Actual FTE
Role1Pro401-Mar-221430.89
Role1Pro401-Apr-22980.61
Role1Pro401-May-221661.04
Role1Pro401-Jun-221771.11
Role2Pro401-Mar-222001.25
Role2Pro401-Apr-223001.88
Role2Pro401-May-221430.89
Role2Pro401-Jun-221200.75
Role3Pro401-Mar-221330.83
Role3Pro401-Apr-222601.63
Role3Pro401-May-222131.33
Role3Pro401-Jun-223402.13
Role4Pro401-Mar-221230.77
Role4Pro401-Apr-221200.75
Role4Pro401-May-222601.63
Role4Pro401-Jun-221601.00

 

Current measure reads 

 

Actuals = SELECTEDVALUE('Actual Hours'[Average Actual FTE])​

 

 Thank you

  • 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.

2 Replies

  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Community Support

    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.