Forum Discussion

CALCULATEpizza's avatar
CALCULATEpizza
Frequent Visitor
4 years ago
Solved

Create Measure - Period On Period % Diff, Based On User's Input In Built-In Relative Date Slicer For

Hi everyone!   Would appreciate any help on the following requirements:   I'd like to create a measure for: - Period On Period % Diff - Based On User's Input In Built-In Relative Date Slicer -...
  • MFelix's avatar
    MFelix
    4 years ago

    Hi CALCULATEpizza ,

     

    Believe that the main issue you have here is the fact that you cannot know how the relative slicer selection is made, if it's on weeks, month or days.

     

    What you can do keeping the two measures you have is to create a measure that gets the context of the matrix, and returns the correct measure:

     

    Switch bewteen = if(ISINSCOPE('Date Dimension'[Week]), [WEEK ON WEEK % DIFFERENCE], [MONTH ON MONTH % DIFFERENCE])

     

    Has you can see when you drill up or down the calculations changes: