Forum Discussion

dkozak's avatar
dkozak
Frequent Visitor
7 years ago
Solved

Previous Period within SUMX Issue :(

Hi Community,

i just discover an issue in the calculation of sumx in previous period( previousMonth(), lastYear()..etc).

I explain the context: 

i have a sample table containing the columns: date, product, unit price, quantity

And i need to calculate the evolution of sales by month( divide Sales month by Sales month -1 ), so logically i will use the following formulas: 

Sales Amount = unit price * Quantity

and to do it correctly i used sumx like: 

Sales Amount = CALCULATE(SUMX(Sheet1; Sheet1[Quantity]*Sheet1[Unit Price]))
then i calculate the sales of the previous month like: 
Previous Monthe Sales = CALCULATE([Sales Amount]; PREVIOUSMONTH(Sheet1[Date]))
then i used an other measure to calculate the evolution like: 
Sales Evolution = DIVIDE([Sales Amount]; [Previous Monthe Sales])
the result i got was blank which is not logically, for information i tried also to get the measures in a summaized table and return the calculation but it didnt work
What you can suggest please, any one have an idea.
 
Thanks in advance

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi dkozak ,

    I'd like to suggest you use date function to replace time intelligence functions to manually defined calculation date range. It is more accurate and controllable than time intelligence functions.

    Time Intelligence "The Hard Way" (TITHW)

    Regards,

    Xiaoxin Sheng

2 Replies