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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AliceW
Power Participant
Power Participant

Create a filter with amounts per Customer coming from several Opportunities - it can't be a measure

Hi guys,

This should be simple, but I just can't figure out how to do it, so help :0)

What I have:

I have a table with Customers and Opportunities. One Customer can have one or several Opportunities.

What I need:

To calculate a column (so I can use as a page filter) with the Total Amount per Customer. Based on that, I can create various categories (see 'Customer Total' column below).

 

CustomerOpp #AmountCustomer Total
AAA11000Between 0 and 3000
AAA22000Between 0 and 3000
AAA33000Between 0 and 3000
BBB44000Between 3001 and 5000
BBB55000Between 3001 and 5000

 

If I just create a measure CustomerTotal = sum(Amount) I won't have a filter... 😞

Big thanks,

Alice

1 ACCEPTED SOLUTION
edhans
Super User
Super User

You can create a calculated column that has customer totals using this:

Customer Total = 
VAR CurrentCustomer = Sales[Customer]
RETURN
    CALCULATE(
        SUM(Sales[Amount]),
        FILTER(
            Sales,
            Sales[Customer] = CurrentCustomer
        )
    )

You can then create another column to use as your filter amount using SWITCH for your ranges:

Customer Range = 
SWITCH(
    TRUE(),
    Sales[Customer Total] <  3000, "Between 0 and 3000",
    AND(Sales[Customer Total] > 3000,Sales[Customer Total] <= 5000), "Between 3001 and 5000",
    "Over 5000"
    )


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Super User
Super User

You can create a calculated column that has customer totals using this:

Customer Total = 
VAR CurrentCustomer = Sales[Customer]
RETURN
    CALCULATE(
        SUM(Sales[Amount]),
        FILTER(
            Sales,
            Sales[Customer] = CurrentCustomer
        )
    )

You can then create another column to use as your filter amount using SWITCH for your ranges:

Customer Range = 
SWITCH(
    TRUE(),
    Sales[Customer Total] <  3000, "Between 0 and 3000",
    AND(Sales[Customer Total] > 3000,Sales[Customer Total] <= 5000), "Between 3001 and 5000",
    "Over 5000"
    )


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
AliceW
Power Participant
Power Participant

Thank you so much!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (2,456)