Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Vertical lines in a graph

Hello,   I have several line charts in a report where date in on the x-axis like this   Is there a smart way to draw vertical lines on certain days, like when a certain marketing campaign s...
  • v-gizhi-msft's avatar
    6 years ago

    Hi,

     

    According to your description, i think your requirement can not be reached completely, but i have a workaround:

    Please choose Line and Clustered Column Chart visual.

    Then try this measure:

    Measure = 
    IF (
        DISTINCTCOUNT ( 'Slicer Table'[Date] ) = BLANK ()
            || DISTINCTCOUNT ( 'Slicer Table'[Date] )
                = CALCULATE ( DISTINCTCOUNT ( 'Slicer Table'[Date] ), ALL ( 'Slicer Table' ) ),
        BLANK (),
        IF (
            MIN ( 'Table'[Date] ) IN DISTINCT ( 'Slicer Table'[Date] ),
            MAXX (
                CALCULATETABLE ( DISTINCT ( 'Table'[Date] ), ALLSELECTED ( 'Table'[Date] ) ),
                CALCULATE ( SUM ( 'Table'[Sales] ) )
            )
        )
    )

    Create another seperate slicer table:

    Slicer Table = SELECTCOLUMNS('Table',"Date",'Table'[Date])

    When choose one or more dates you want in slicer, the result shows:

    You can also use another custom visual called Multiple Axes Chart - XViz :

    The result shows:

    Here is my test pbix file:

    pbix 

    Hope this helps.

     

    Best Regards,

    Giotto Zhi