Thanks for the explanation.
I created a one-column table with four rows (Year, Quarter, Month, and Day)
Then I created the following measure for calculating the dynamic amount based on the selected value of the table:
Pledged Money LY-LQ-LM-LD =
VAR DateScope = SELECTEDVALUE( 'Scope Table'[Scope])
RETURN
SWITCH( TRUE(),
DateScope = "Year",
CALCULATE( [Pledged Money] , DATEADD( Dates[Date], -1, YEAR)),
DateScope = "Quarter",
CALCULATE( [Pledged Money] , DATEADD( Dates[Date], -1, QUARTER)),
DateScope = "Month",
CALCULATE( [Pledged Money] , DATEADD( Dates[Date], -1, MONTH)),
DateScope = "Day",
CALCULATE( [Pledged Money] , DATEADD( Dates[Date], -1, DAY))
)
And then I used the following measure to have differences for various scopes:
Pledged Money Diff = [Pledged Money] - [Pledged Money LY-LQ-LM-LD]
The result was like this:
When I click on different scopes, I receive different amount -that I think that is exactly what you are looking for.
But my questions are:
- Are the results we will get are meaningful, for example by Month, or Day, when we have Year for the X-axis?
- Since we cannot change the X-axis, what is the proper selection for it?
And about your second question, I think it is feasible using a method somehow like what I explained above for your first question. You need to create different measures for profits and orders, and then use switch function to have a new measure that will give you the proper result based on your selection for “Sales, Profit, or Orders”.
Regards