Forum Discussion

Fali324's avatar
Fali324
Icon for Helper II rankHelper II
1 year ago
Solved

Line chart customisation

Hi, I have this line chart which is set up in the following way: X axis - Stage Y Axis - Duration Legend - Project I have a slicer with the columns Project & Active which is yes/no for e...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Fali324 

     

    Certainly, please check the following changes:

    Change the x-asix Table:

     

     

    X-axis =
    UNION (
        VALUES ( 'Table'[Project] ),
        SELECTCOLUMNS (
            VALUES ( 'Table'[Project] ),
            "Project", "Select-" & 'Table'[Project]
        )
    )
    

     

     

    And so do the Measure:

     

     

    MEASURE =
    VAR _Slicer =
        VALUES ( Slicer[Project] )
    VAR _length =
        MAXX ( ADDCOLUMNS ( 'X-axis', "Length", LEN ( 'X-axis'[Project] ) ), [Length] ) - 7
    VAR _CurrentPro =
        SELECTEDVALUE ( 'X-axis'[Project] )
    RETURN
        IF (
            _CurrentPro IN VALUES ( 'Table'[Project] ),
            CALCULATE ( SUM ( 'Table'[Duraction] ), 'Table'[Project] = _CurrentPro ),
            IF (
                ISFILTERED ( Slicer[Project] ),
                CALCULATE (
                    SUM ( 'Table'[Duraction] ),
                    'Table'[Project]
                        IN _Slicer
                            && 'Table'[Project] = MID ( SELECTEDVALUE ( 'X-axis'[Project] ), 8, _length )
                )
            )
        )
    

     

     

    Then select all the selections of the Slicer and Open all the lines of the selections with "Select-":

    You can alse change the Color:

     

    The result is as follow:

    Best Regards

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