Forum Discussion

ilui's avatar
ilui
Frequent Visitor
6 years ago
Solved

Delta calculation based on dynamic Slicer

Hi,   I'm stuck with this New Measure field and I'd like to seek your help. We're taking Salesforce snapshot data and want to show comparison of forecast based on different snapshot date. Which sna...
  • v-yingjl's avatar
    6 years ago

    Hi ilui ,

    Based on your description, you can create this measure:

    Forecast Diff =
    VAR _max =
        CALCULATE ( MAX ( 'Table'[Snapshot Date] ), ALLSELECTED ( 'Table' ) )
    VAR _min =
        CALCULATE ( MIN ( 'Table'[Snapshot Date] ), ALLSELECTED ( 'Table' ) )
    VAR _maxsum =
        CALCULATE ( SUM ( 'Table'[Forecast] ), 'Table'[Snapshot Date] = _max )
    VAR _minsum =
        CALCULATE ( SUM ( 'Table'[Forecast] ), 'Table'[Snapshot Date] = _min )
    RETURN
        _maxsum - _minsum

    To achieve the same visual, create two matrix to use visual overlay:

     

    Attached the sample file that hopes to help you: Forecast data.pbix

     

    Best Regards,
    Yingjie Li

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