Forum Discussion
Create Measure - Period On Period % Diff, Based On User's Input In Built-In Relative Date Slicer For
- 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:
Hi CALCULATEpizza ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure =
VAR _sum =
CALCULATE (
SUM ( 'Sales Data'[QTY Sold] ),
FILTER (
ALL ( 'Date Dimension' ),
'Date Dimension'[Week] = SELECTEDVALUE ( 'Date Dimension'[Week] )
)
)
RETURN
DIVIDE ( SUM ( 'Sales Data'[QTY Sold] ), _sum )
If I have misunderstood your meaning, please provide your desired output with a screenshot.
How to Get Your Question Answered Quickly
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous,
Thanks so much for your response, unfortunate the measure doesn't provide the output I'm looking for. I've updated my original post with the expected results.
I have also reuploaded the pbix file. In this update:
- added 2 measures to demonstrate what the output should be
- MFelix4 years agoSuper User
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:
- CALCULATEpizza4 years agoFrequent Visitor
MFelix Thanks so much! This solves exactly what I'm trying to accomplish. Appreciate your time looking into this.