Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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).
Customer | Opp # | Amount | Customer Total |
AAA | 1 | 1000 | Between 0 and 3000 |
AAA | 2 | 2000 | Between 0 and 3000 |
AAA | 3 | 3000 | Between 0 and 3000 |
BBB | 4 | 4000 | Between 3001 and 5000 |
BBB | 5 | 5000 | Between 3001 and 5000 |
If I just create a measure CustomerTotal = sum(Amount) I won't have a filter... 😞
Big thanks,
Alice
Solved! Go to Solution.
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" )
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingYou 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" )
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThank you so much!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
55 | |
37 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |