mgirvin
Well-known Member
- Joined
- Dec 15, 2005
- Messages
- 1,245
- Office Version
- 365
- Platform
- Windows
Dear Team,
I have a table of dates and GE Stock Prices. I would like a Calculated Column that calculates the change in stock value day by day. THE DAX I have created is this:
Calculated Column for Change in GE Stock Prom Previous =
IF (
MIN ( GEPrices[Date] ) = GEPrices[Date],
BLANK (),
GEPrices[GE Close]
- LOOKUPVALUE (
GEPrices[GE Close],
GEPrices[Date], MAXX (
FILTER ( ALL ( GEPrices[Date] ), GEPrices[Date] < EARLIER ( GEPrices[Date] ) ),
GEPrices[Date]
)
)
)
The table I have is this:
Date GE Close
3/8/19 9.58
3/11/19 9.9
3/12/19 9.76
3/13/19 10.02
3/14/19 10.3
3/15/19 9.96
3/18/19 10.2
3/19/19 10.19
3/20/19 10.22
3/21/19 10.27
3/22/19 9.98
3/25/19 9.88
3/26/19 10.1
3/27/19 9.96
3/28/19 9.89
3/29/19 9.99
4/1/19 10.1
4/2/19 10.24
4/3/19 10.1
4/4/19 10.03
4/8/19 9.49
Is this an efficient formula? Is there a better way to do this?
I have a table of dates and GE Stock Prices. I would like a Calculated Column that calculates the change in stock value day by day. THE DAX I have created is this:
Calculated Column for Change in GE Stock Prom Previous =
IF (
MIN ( GEPrices[Date] ) = GEPrices[Date],
BLANK (),
GEPrices[GE Close]
- LOOKUPVALUE (
GEPrices[GE Close],
GEPrices[Date], MAXX (
FILTER ( ALL ( GEPrices[Date] ), GEPrices[Date] < EARLIER ( GEPrices[Date] ) ),
GEPrices[Date]
)
)
)
The table I have is this:
Date GE Close
3/8/19 9.58
3/11/19 9.9
3/12/19 9.76
3/13/19 10.02
3/14/19 10.3
3/15/19 9.96
3/18/19 10.2
3/19/19 10.19
3/20/19 10.22
3/21/19 10.27
3/22/19 9.98
3/25/19 9.88
3/26/19 10.1
3/27/19 9.96
3/28/19 9.89
3/29/19 9.99
4/1/19 10.1
4/2/19 10.24
4/3/19 10.1
4/4/19 10.03
4/8/19 9.49
Is this an efficient formula? Is there a better way to do this?