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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
cdawidow
Helper III
Helper III

Calculating Total Sales for a selected Product and its share based on customer you are evaluating

Hi guys, I want to calculate the  sales amount of a customer given a specific product  in comparison to the total sales of the company as a whole for that same product but I am having trouble with my calculations.  

 

To get total sales of customer I just use a simple  CUSTOMER SALES = CALCULATE(TOTAL SALES) which would be filtered when I select my customer and product.

 

But for total sales of that product should I use ALL or ALLSELECTED.  CALCULATE(TOTAL SALES),ALL(TABLE),PRODUCT = ALLSELECTED(PRODUCT)) ???

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

// Assumptions:
// Sales - fact table with sales
// Customers - dimension that stores all customers
//             and joins to Sales on CustomerID.
// Products - dimension that stores all prouducts
//            and joins to Sales on ProductID

[Total Sales] = SUM( Sales[Amount] )

[Total Sales (All Custs)] =
CALCULATE(
    [Total Sales],
    ALL( Customers )
)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

// Assumptions:
// Sales - fact table with sales
// Customers - dimension that stores all customers
//             and joins to Sales on CustomerID.
// Products - dimension that stores all prouducts
//            and joins to Sales on ProductID

[Total Sales] = SUM( Sales[Amount] )

[Total Sales (All Custs)] =
CALCULATE(
    [Total Sales],
    ALL( Customers )
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.