Forum Discussion

miikasa's avatar
miikasa
Frequent Visitor
2 years ago
Solved

Problems with accumulated values

Hi guys,

 

I'm trying to calculate the accumulated values of the SalesIndex measure starting on February.

Here is what I have vs what I need:

 

What I have:

 

What I need:

 

And these are the measures:

SalesIndex = 

DIVIDE(

[SalesAmount], 
[AverageCurrentMonthPreviousMonth],

0

)

 

TotalSalesIndex =
    SUMX('Database',
    [SalesIndex])

 

 

AcumullatedSalesIndex =
CALCULATE(
    [TotalSalesIndex],
    'Calendar'[Date] <= MAX('Calendar'[Date]),
    YEAR('Calendar'[Date]) = YEAR(MAX('Calendar'[Date])) 
)
 
When I compare the AcumullatedSalesIndex, it is not accumulating the values of SalesIndex measure per month. Do you guys have any ideas on how to solve it?

Thank you very much.


  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi miikasa ,

     

    I created some data:

     

     

    Here are the steps you can follow:

     

    1.Create calculated column.

    Index = 
    MINX(
        FILTER(ALL('Table 2'),
        'Table 2'[Month]=EARLIER('Table'[Month])),[Month_Number])
    

     

    2.Create measure.

    Measure = 
    SUMX(
        FILTER(ALL('Table'),
        'Table'[Index]<=MAX('Table'[Index])),[SalesIndex])
    

     

    3.Result:

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

     

3 Replies

  • Hi,

    What do you mean by "starting on Feb"?

    Assuming in a slicer, you hve selected a Year (dragged from the Calendar table) and the months are also dragged from the Calendar Table, write this measure

    RT = calculate([salesindex],datesytd(calendar[date],"31/12"))

    If this does not work, then share the download link of the PBI file.  Clearly show the problem there.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi miikasa ,

     

    I created some data:

     

     

    Here are the steps you can follow:

     

    1.Create calculated column.

    Index = 
    MINX(
        FILTER(ALL('Table 2'),
        'Table 2'[Month]=EARLIER('Table'[Month])),[Month_Number])
    

     

    2.Create measure.

    Measure = 
    SUMX(
        FILTER(ALL('Table'),
        'Table'[Index]<=MAX('Table'[Index])),[SalesIndex])
    

     

    3.Result:

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.