cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MasterCamus
Frequent Visitor

Can't get the total amount when filtering by TOPN

Hi guys,

 

I'm using filters to filter the top 10 customers (first name) by [customer sale]. This is working fine. However, I'm trying to get the total of those top 10 so I can calculate %.

Total Sales =
CALCULATE(
[Customer Sale],
REMOVEFILTERS('Customer Lookup'[customer_first-name]
)
)
 
Customer Sale =
SUMX(
'Sales by Store',
'Sales by Store'[quantity_sold] * 'Sales by Store'[unit_price]
)
 
Example of what I'd want.
Allen = 1,741.50 / 17,950.59

MasterCamus_1-1634693924305.png

 

MasterCamus_0-1634694160740.png

Is this because of the filters?

Any tips?

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your data model looks like,  but try to use ALLSELECT instead of using Removefilters.


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.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your data model looks like,  but try to use ALLSELECT instead of using Removefilters.


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.

Best regards, JiHwan Kim

Linkedin: https://www.linkedin.com/in/jihwankim1975/

Twitter: https://twitter.com/Jihwan_JHKIM

View solution in original post

This worked. Thank you.

 

% Customer Sales by Group =
VAR _TotalCustomerSales =
CALCULATE(
[Customer Sale],
ALLSELECTED(
'Customer Lookup'[customer_first-name]
)
)

RETURN
DIVIDE(
[Customer Sale],
_TotalCustomerSales
)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.