Forum Discussion

giuliapiazza94's avatar
2 years ago
Solved

Cumulative measure / 100

Hi guys,

i need to create a measure that works like this:

 

 

 

 

 

How can I create it?

 

Thank you all 🙂

  • Anonymous's avatar
    Anonymous
    2 years ago

    bhanu_gautam , Thank you for your positive response to the post.

     

    Hi giuliapiazza94 

     

    Here is my solution, I hope this helps.

    1.Create a measure to calculate Y/100.

    FirstMonthYDiv100 = CALCULATE(
        MIN('Table'[Y]), 
        FILTER(
            ALL('Table'), 
            'Table'[Month] = MINX(ALL('Table'), 'Table'[Month]
            )
        )
    )/100

     

    2.Create a cumulative measure for column X.

    CumulativeSumX = CALCULATE(
        SUM('Table'[X]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[Month] <= MAX('Table'[Month])
        )
    )

     

    3.Create a measure Z.

    Z = [FirstMonthYDiv100] + [CumulativeSumX]

     

    4.Here is my final result.

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

    • giuliapiazza94's avatar
      giuliapiazza94
      Icon for Helper IV rankHelper IV

      X and Y are two measures.

      X = total of new customers of month

      Y = total customers

       

      I need to create Z: 

      Z of first month selected (in this example is january) = Y / 100

      Z of other months =  Z(previous month) + X

  • Anonymous's avatar
    Anonymous
    Not applicable

    bhanu_gautam , Thank you for your positive response to the post.

     

    Hi giuliapiazza94 

     

    Here is my solution, I hope this helps.

    1.Create a measure to calculate Y/100.

    FirstMonthYDiv100 = CALCULATE(
        MIN('Table'[Y]), 
        FILTER(
            ALL('Table'), 
            'Table'[Month] = MINX(ALL('Table'), 'Table'[Month]
            )
        )
    )/100

     

    2.Create a cumulative measure for column X.

    CumulativeSumX = CALCULATE(
        SUM('Table'[X]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[Month] <= MAX('Table'[Month])
        )
    )

     

    3.Create a measure Z.

    Z = [FirstMonthYDiv100] + [CumulativeSumX]

     

    4.Here is my final result.

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.