Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

SUMX and Time Intelligence

Hello,

 

Thanks for reading.

 

I am trying to create a measure utilizing SUMX. I want to calculate at the row level a Ratio * Dollar amount and sum it up.

The data is in a similar format as to what is below but due to company policy I dont believe I can post real data.

DateProductSoldTotal Dollars Sold
201901A101000
201901B161200
202001A121400
202001B161200

 

The final measure is something like 

 

 

FinalMeasure = SUMX(SalesTable, [PriceChange] * [Total Dollars Sold])

 

 

I created a price measure--

 

 

Price = DIVIDE(SUM(Total Dollars Sold), SUM(Sold))

 

 

Then creating a Prior Year Price--

 

 

PYPRICE = CALCULATE([Price], SAMEPERIODLASTYEAR('YearMonthBridge'[Date]))

 

 

Then a Price Change measure by taking the quotient of the above two measures.

 

While troubleshooting my SUMX measure i began to SUMX each portion of the measure to determine where the issue was. When I did a SUMX of the PY measure--

 

 

SUMXPY = SUMX(SalesTable,PYPRICE)

 

 

The returned value is always nothing/null. All of the other SUMX(PRICE) etc... are working correctly.

 

Edit-- I should also add. The PY Price measure works correctly by itself as my Date column is connected to a Date Table.

 

Is it possible to use SUMX with Time Intelligence? I am having a hard time wrapping my head around this!! Any help would be appreciated.

 

Thanks for reading

5 Replies