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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to calculate total sales

Hi! I am pretty new to Power Bi and I am having troubles calculating the total sales with a measure.

Basically the data model is that the customers have multiple properties and they can book multiple cleaning services for their properties. Each cleaning service has a different price cost.

I was able to show a visual of the sales for each service by creating a measure.

However I would also like to show the total of the sales which would be 5139 € in another visual if not possible to show it in the same visual. So basically I want to be able to show the sales for each service/category and the total sales.

 

Datamodell.PNGsales per service.PNG

Here is the sample file: https://1drv.ms/u/s!AuHkRkg43pTjgXV7O0QSG3rfwBZe?e=OjAJEj

 

I really appreciate the help!

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I solved the number of customers with the countx measure.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I solved the number of customers with the countx measure.

Anonymous
Not applicable

@AllisonKennedy  omg thank you! it works 🙂 you are a life saver

AllisonKennedy
Super User
Super User

@monacharline21 You can keep order and order details in separate tables. This is good. Simply use the RELATED() function to get the price in the order details table.

Try this measure:

Total Sales: SUMX(T_Auftragsdetails, RELATED(D_Dienstliestugen[Preis]))

I'm sorry about my spelling - I hope it makes sense and help.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

@AllisonKennedy Thank you!

would you by any chance also know how to show the number of customers? If I use the measure count(T_Kunden[K_Nummer]) it says 16. Which is basically correct as a total. But if I choose a certain service in the filter/slicer it sticks to 16 and does not change. But for instance if I choose Gartenpflege I want to see the number of customers who purchased this service. 

@Anonymous  Maybe try 

 

Count Customers = CALCULATE(COUNTROWS(T_Kunden), SUM(T_Auftragsdetails[ATD_D_Nummer] > 0))

 

Again, check my spelling (apologies)


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

ok thank you. But if I include the order details meaning the service number in the orders table I am only able to put in one service for each order. Or can the same order number be included twice in the table?

 

Thank you!

Is there no way to work with the current model and calculate the total sales?

daxer-almighty
Solution Sage
Solution Sage

First and foremost, you should look at how to properly model data where there are orders and order details. Sadly, the pattern for doing this is not present at www.daxpatterns.com. This is unfortunate as it only is explained in Marco and Alberto's courses on DAX. But I'll give you a hint: you should not separate the Orders table from Order Details. They should be contained in one single fact table.

 

Exactly the same applies to Properties and Property Details. You should unify the two tables.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors