Forum Discussion
awolf88
Helper II
3 years agoDisplaying Change in Value by date selection
Dearest community, I'm sure there is a really simple way of doing this, but once again I can't seem to be figuring this out on my own: I have a very simple table of Open orders by Customer: ...
- 3 years ago
You can create a measure like
Diff = VAR MinDate = CALCULATE( MIN( 'OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived]) ) VAR MaxDate = CALCULATE( MAX('OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived] ) ) VAR StartValue = CALCULATE( [total Open Orders], ALLEXCEPT(OpenOrders, OpenOrders[Customer]), 'OpenOrders'[date_archived] = MinDate ) VAR EndValue = CALCULATE( [total Open Orders], ALLEXCEPT(OpenOrders, OpenOrders[Customer]), 'OpenOrders'[date_archived] = MaxDate ) RETURN EndValue - StartValueIn order to get the matrix to display correctly you need to turn off word wrap for column headings and values and then set the width of the Diff column which appears under the first date to 0.
johnt75
Super User
3 years agoYou can create a measure like
Diff =
VAR MinDate = CALCULATE( MIN( 'OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived]) )
VAR MaxDate = CALCULATE( MAX('OpenOrders'[date_archived]), ALLSELECTED(OpenOrders[date_archived] ) )
VAR StartValue = CALCULATE(
[total Open Orders],
ALLEXCEPT(OpenOrders, OpenOrders[Customer]),
'OpenOrders'[date_archived] = MinDate
)
VAR EndValue = CALCULATE(
[total Open Orders],
ALLEXCEPT(OpenOrders, OpenOrders[Customer]),
'OpenOrders'[date_archived] = MaxDate
)
RETURN EndValue - StartValue
In order to get the matrix to display correctly you need to turn off word wrap for column headings and values and then set the width of the Diff column which appears under the first date to 0.
awolf88
Helper II
3 years agoWow, this works amazing!!! Thank you sooo so much for your help!
Best,
Alex