Forum Discussion

amhiggins's avatar
amhiggins
Frequent Visitor
5 years ago
Solved

Single Date Slicer to Apply Different Date Ranges to Different Plots

Hello!   I haven't quite be able to find a solution that fits my need, if there is one already please point me to it and apologies for the duplication!   I have a dashboard with two plots - one s...
  • v-xiaotang's avatar
    5 years ago

    Hi amhiggins 

    Not clear how your data model and table structure look like, so I create a sample:

     

    You may take steps for reference:

    Create the measure:

    secondmeasure =
    VAR _max =
        SELECTEDVALUE ( 'Table'[orderdate] )
    RETURN
        CALCULATE (
            SUM ( 'Table'[salestotal] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[orderdate].[Year] = YEAR ( _max )
                    && 'Table'[orderdate] >= 1
                    && 'Table'[orderdate] <= _max
            )
        )

    Result:

    When you select 2020.2, secondmeasure counts total during 2020.1-2020.2

    When you select 2021.05, secondmeasure counts total during 2021.1-2021.5

     

     

    Hope it helps.

     

    Best Regards,

    Community Support Team _ Tang

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