Forum Discussion

wayne_taylor's avatar
wayne_taylor
Regular Visitor
6 years ago
Solved

Using single date slicer to filter three visuals by different ranges

Hi All I've been wrestling with this one for a few days now, hopefully someone can help me! I've got a Date Slicer set to select a single date in a dropdown and I am applying this to a visual w...
  • MFelix's avatar
    6 years ago

    Hi wayne_taylor ,

     

    When making the use of slicer you are filtering the information in your visual so when you have more than one visual that you need to have different periods you need to have a disconnected date for the slicer then you need to create some measure similar to this ones:

     

    Single Date Visual =
    CALCULATE (
        SUM ( Table[Column] );
        FILTER (
            ALL ( Table[Column Date] );
            Table[Column Date] = MAX ( FilterTable[Column Date] )
        )
    )
    
    
    7 Days Date Visual =
    CALCULATE (
        SUM ( Table[Column] );
        FILTER (
            ALL ( Table[Column Date] );
            Table[Column Date] <= MAX ( FilterTable[Column Date] )
                && Table[Column Date]
                    >= MAX ( FilterTable[Column Date] ) - 7
        )
    )
    
    21 Days Date Visual =
    CALCULATE (
        SUM ( Table[Column] );
        FILTER (
            ALL ( Table[Column Date] );
            Table[Column Date] <= MAX ( FilterTable[Column Date] )
                && Table[Column Date]
                    >= MAX ( FilterTable[Column Date] ) - 21
        )
    )

     

    Then use the Date of the mains table of the dates as X-axis on your visual and the measures on each of the visual should work as expected.

     

    See attach file.

     

    Regards,

    MFelix