Forum Discussion

dplank's avatar
dplank
Frequent Visitor
8 years ago
Solved

Calculate Column Values Based on Slicer

Hello,   I am needing to create a field for the individuals pay.  It is based on whether the individual had $2.5 million or more in sales for a given month.  So I need a field that would be .0096 o...
  • v-juanli-msft's avatar
    v-juanli-msft
    8 years ago

    Hi dplank

    As tested with same dataset, I use a differenet condition for the "year to date" total, you can change the value to meet your needs in your scenario.

    First, for your first problem, you can modify my formula to show sum based on sales associates.

    sum1 =
    CALCULATE (
        SUM ( Sheet2[Amount] ),
        FILTER (
            ALLEXCEPT ( Sheet2, Sheet2[month] ),
            [sales associate] = SELECTEDVALUE ( Sheet2[sales associate] )
        )
    )
    
    sum2 = IF([sum1]>=2500000,[sum1]*0.0096,[sum1]*0.0092)

     

     

    For year to date total, you can use the following formula

    running total =
    CALCULATE (
        SUM ( Sheet2[Amount] ),
        FILTER (
            ALLEXCEPT ( Sheet2, Sheet2[sales associate] ),
            [Date] <= MAX ( [Date] )
        )
    )

    running total 2 = IF([running total]>4659849,[running total]*0.0094,[running total]*0.0098)

     

     

     

    Best Regards

    Maggie