dax formula to calculate company totals

metal123

New Member
Joined
Mar 26, 2015
Messages
9
[TABLE="width: 500"]
<tbody>[TR]
[TD]Company Name[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]Company A[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Company A[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Company C[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Company B[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]Company A[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]Company C[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]Company B[/TD]
[TD]600[/TD]
[/TR]
[TR]
[TD]Company B[/TD]
[TD]1000[/TD]
[/TR]
</tbody>[/TABLE]

In this example,
Company A=300
Company B=2100
Company C=700

I would like to utilize a dax function that calculates the totals of all the companies in the data set.

I have tried using this example,
SUMX() - The 5-point palm, exploding fxn technique - PowerPivotPro

I was successful in getting the results in the example, but was not able to apply it to my data set. Any suggestions or solutions?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
There are lots of ways to do this and there is a quick and dirty way. But I recommend learning best practices as you start out even for simple examples.
1. What you have posted is a data table (I will call it DATA). You should create a lookup table that consists of all the company names (I will call the table COMPANIES and the column COMPANY) - 1 record for each unique name. Then join the data table to this new lookup table. Read about data shape in my knowledge base here => The Optimal Shape for Power Pivot Data -
2. Create a pivot table connected to your data model. Place the COMPANY column from your COMPANIES lookup table on rows in your pivot table.
3. Select the pivot table and then write the following measure (calculated field in Excel 2013).
=SUM(Data[Amount])

This new measure should be placed in your pivot table automatically after saving and will give you the result.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,152
Messages
6,176,724
Members
452,740
Latest member
MrCY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top