Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
dplank
Frequent Visitor

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 of the total amount for the month if the total amount for the month is at or above $2.5 million or .0092 of the total amount if the total amount for the month is below $2.5 million.  I have a slicer for the month and when the user selects different month's, I need this value to update. 

 

So if user selected June, this value should be $52,627.54 (.0096 * $5,482,035).  If the user selected April, this value should be $17,719.57 (.0092 * $1,926,040).

 

Below is part of the data from my transaction table.  Is this possible?

 

DateAmountName
4/5/2018163,500.00Troy
4/10/2018224,000.00Troy
4/20/2018261,900.00Troy
4/23/2018452,000.00Troy
4/24/2018218,000.00Troy
4/24/2018151,320.00Troy
4/24/201885,360.00Troy
4/25/2018369,960.00Troy
5/1/2018241,559.00Troy
5/2/2018220,000.00Troy
5/2/2018261,250.00Troy
5/7/2018391,000.00Troy
5/8/2018214,400.00Troy
5/14/201890,000.00Troy
5/15/2018432,000.00Troy
5/17/2018161,250.00Troy
5/17/2018150,350.00Troy
5/18/2018252,000.00Troy
5/24/2018320,000.00Troy
5/25/2018216,000.00Troy
5/30/2018113,000.00Troy
5/30/2018253,175.00Troy
5/31/2018196,000.00Troy
5/31/2018336,000.00Troy
6/1/2018117,370.00Troy
6/8/2018255,500.00Troy
6/11/2018233,910.00Troy
6/11/2018888,000.00Troy
6/13/2018262,500.00Troy
6/15/2018296,000.00Troy
6/18/2018176,000.00Troy
6/21/2018288,000.00Troy
6/22/2018326,800.00Troy
6/22/2018180,000.00Troy
6/25/2018403,750.00Troy
6/25/2018266,250.00Troy
6/26/2018236,000.00Troy
6/27/2018204,155.00Troy
6/28/2018204,000.00Troy
6/28/2018218,500.00Troy
6/29/2018185,500.00Troy
6/29/2018274,800.00Troy
6/29/2018465,000.00Troy

 

Also, another individual is paid based on year to date totals.  So when his year to date total amount exceeds $10 million, I need to increase his pay to .0098 of total amount for the month instead of .0094 of total amount for the month.  The format of the data is just like I posted above.  Is this possible?

 

Thank you,

 

Dan

1 ACCEPTED SOLUTION

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)

1.png

 

 

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)

 2.png

 

 

Best Regards

Maggie

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @dplank

Bothe your requirements are possible to do, for the second scenario, could you explain what is the year to date total amount ?

For the first requirement, i can achieve what you expected, look at test below.

Create a calculated column "month" and two measures

month = MONTH([Date])
sum1 = CALCULATE(SUM(Sheet2[Amount]),ALLEXCEPT(Sheet2,Sheet2[month]))
sum2 = IF([sum1]>=2500000,[sum1]*0.0096,[sum1]*0.0092)

1.png

 

Best Regards

Maggie

Thank you for these formulas.  They work with what I was asking.  I added the year to your formula too.  What I failed to mention is that there are about 30 sales associates I want to show in a table how much they got paid.  With the formula above, it doesn't filter out by sales associate.  See below for what it looks like with a sample of my data.  It is taking the total of all associates combined.  How can I get it to filter it out so it just includes the sales for each associate on their own line?

Capture.JPG

 

 

 

For the year to date, I need to keep a running total of amount of sales (column Amount) and when the year to date total hits $10 million, then the pay would be .0098 of the total amount.  So with the data given above, let's say this individual hit $10 million YTD on the 5/24/18 transaction.  His pay should look like this for May: sum(amount up to and including the 5/24 transaction)*.0094 + sum(amount after 5/24 to month end)*.0098.  And then everything for the rest of the year would be at sum(amount)*.0098 for each month.  Does this make sense and is it possible?

 

This is just for illustrative purposes.  This indivual is not paid both ways; only the first way, but I thought it would be easiest to explain the year to date portion using the same data.

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)

1.png

 

 

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)

 2.png

 

 

Best Regards

Maggie

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.