Forum Discussion

jay_patel's avatar
jay_patel
Helper IV
5 years ago
Solved

Want cumulative

Hello All

 

I want a cumulative for SBU, tried a lot but not getting the result. Attaching Dax and result's too.

As you can see I want cumulative of measure "CalculatedbySBU" and the dax for both measure i.e. cumulative & CalculatedbySBU is as mentioned below.

 

 

1)
cumulative =
CALCULATE (
[CalculatedBySBU-date],
FILTER (SDirectSales,SDirectSales[SBU.SBU] >= MAX( SDirectSales[SBU.SBU] )
 
)
)
 
2)
CalculatedBySBU-date = CALCULATE(CALCULATE([Primary Sales1]),FILTER (
ALLSELECTED( 'SDirectSales' ),
SDirectSales[Month-Year] = MAX( SDirectSales[Month-Year] )
&& SDirectSales[SBU.SBU] = MAX( SDirectSales[SBU.SBU] )))

 

  • Hi, jay_patel 

    Please try the below measure.

     

    cumulative =
    VAR current = [CalculatedBySBU-date]
    RETURN
    CALCULATE (
    [CalculatedBySBU-date],
    FILTER ( ALL ( SDirectSales[SBU.SBU] ), [CalculatedBySBU-date] >= current )
    )
     

    Hi, My name is Jihwan Kim.

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

  • jay_patel 

    maybe you can try this

    cumulative =
    CALCULATE (
    [CalculatedBySBU-date],
    FILTER (SDirectSales,SDirectSales[SBU.SBU] <= MAX( SDirectSales[SBU.SBU] )

     

    i'm sry that I don't quite understand the logic of your second measure.

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jay_patel ,

     

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.😀

     

    Best Regards,
    Eyelyn Qin

  • Hi, jay_patel 

    Please try the below measure.

     

    cumulative =
    VAR current = [CalculatedBySBU-date]
    RETURN
    CALCULATE (
    [CalculatedBySBU-date],
    FILTER ( ALL ( SDirectSales[SBU.SBU] ), [CalculatedBySBU-date] >= current )
    )
     

    Hi, My name is Jihwan Kim.

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

  • jay_patel 

    maybe you can try this

    cumulative =
    CALCULATE (
    [CalculatedBySBU-date],
    FILTER (SDirectSales,SDirectSales[SBU.SBU] <= MAX( SDirectSales[SBU.SBU] )

     

    i'm sry that I don't quite understand the logic of your second measure.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jay_patel ,

     

    According to my understanding, you want to calculate the grant total for [CalculatedBySBU-date] measure,right?

    You could use SUMX() like this:

    cumulative = SUMX('SDirectSales',[CalculatedBySBU-date])

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

  • jay_patel  Hey MAte Try this .

     

    Sale running total in Sales Person =
    CALCULATE(
        SUM('Sheet1'[Sale]),
        FILTER(
            ALLSELECTED('Sheet1'[Sales Person]),
            ISONORAFTER('Sheet1'[Sales Person], MIN('Sheet1'[Sales Person]), DESC)
        )
    )

    Kudos will be great.