Forum Discussion

MCassady's avatar
MCassady
Icon for Helper I rankHelper I
4 years ago
Solved

Set RelativeDate Slicer Anchor Based on Another Date Slicer

Hello,   Is there a way to set the anchor date of a relative date slicer, based on another date slicer?   My thought is to have 2 graphs, one showing hourly data for the selected day, and a secon...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi MCassady ,

     

    Here I suggest you to add a new dimdate table in your report. In my report I create DimDate2 based on DimDate.

    DimDate2 = DimDate

    Then use what if parameter to create a last N table for slicer.

    Relationship is as below.

    Measures:

    Value1 =
    CALCULATE (
        SUM ( FactData[Valueused_Standardized] ),
        FILTER ( FactData, FactData[DimDateMinute] = MAX ( DimDate[DateTime] ) )
    )
    Value2 = 
    VAR _SELECTDATE =
        SELECTEDVALUE ( DimDate[DateDay] )
    VAR _LASTDAY =
        SELECTEDVALUE ( 'Last N Day'[Last N Day] )
    RETURN
        CALCULATE (
            SUM ( FactData[Valueused_Standardized] ),
            USERELATIONSHIP ( DimDate2[DateDay], FactData[Datevalue] ),
            FILTER (
                DimDate2,
                DimDate2[DateDay] >= _SELECTDATE - _LASTDAY + 1
                    && DimDate2[DateDay] <= _SELECTDATE
            )
        )

    Keep the interaction of all visual by default. Add measure [Value1] in graph1 and measure[Value2] in graph2. Result is as below.

     

    Best Regards,
    Rico Zhou

     

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