Forum Discussion

HersonD's avatar
HersonD
Helper I
1 year ago
Solved

Cut a line in a Line chart

Hello Fabric Community!

 

I need some help regarding my Line and Clustered Column Chart. I have 2 Accumulating values that I displayed into lines.

Line A is the Actual Values and Line B is the Planned/Projected Value, they're displayed by month. 

I want to stop or cut line A until the current month since it has no value yet for the succeeding months, however for Line B I want to continue it until the last projected month.

 

Please refer to the picture below.

Thanks!

 

 

  • The following dax measure should help you 

    Actual Values Until Current Month =
    VAR LastActualMonth =
    CALCULATE (
    MAX ( 'YourDateTable'[Date] ),
    'YourActualsTable'[Actual Value Column] -- Replace with your actual value column
    )
    RETURN
    IF (
    MAX ( 'YourDateTable'[Date] ) <= LastActualMonth,
    [Your Original Actual Values Measure], -- Replace with your original Actuals measure
    BLANK ()
    )

     

    If you need more help, do not hesistate to share your model or field name 🙂

  • You can detect the date of max date with actual and return blanks if either before or after.

     

    Var dt = max( dates[year month] )

    Var tbl= 

    Addcolumns(

    Allselected( dates[year month] ),

    "@actual", [actual column]

    )

    Var lastDate=

    MAXX(

    Filter( tbl, [@actual] > 0 ),

    Dates[year month]

    )

    Return

    If( lastDate <= dt, [accumulated actual] )

  • you could calculate the accumulated plan using measure 

    if data not found for that month, you can give blank

    Measure = IF(MONTH(SELECTEDVALUE('Table (2)'[Column3]))<8,SUM('Table (2)'[Column2]) ,BLANK())

5 Replies

  • The following dax measure should help you 

    Actual Values Until Current Month =
    VAR LastActualMonth =
    CALCULATE (
    MAX ( 'YourDateTable'[Date] ),
    'YourActualsTable'[Actual Value Column] -- Replace with your actual value column
    )
    RETURN
    IF (
    MAX ( 'YourDateTable'[Date] ) <= LastActualMonth,
    [Your Original Actual Values Measure], -- Replace with your original Actuals measure
    BLANK ()
    )

     

    If you need more help, do not hesistate to share your model or field name 🙂

  • Deku's avatar
    Deku
    Super User

    You can detect the date of max date with actual and return blanks if either before or after.

     

    Var dt = max( dates[year month] )

    Var tbl= 

    Addcolumns(

    Allselected( dates[year month] ),

    "@actual", [actual column]

    )

    Var lastDate=

    MAXX(

    Filter( tbl, [@actual] > 0 ),

    Dates[year month]

    )

    Return

    If( lastDate <= dt, [accumulated actual] )

  • you could calculate the accumulated plan using measure 

    if data not found for that month, you can give blank

    Measure = IF(MONTH(SELECTEDVALUE('Table (2)'[Column3]))<8,SUM('Table (2)'[Column2]) ,BLANK())