Dax Formula - percentages

Guttmann1983

Board Regular
Joined
Jul 27, 2015
Messages
181
Hi, lets say, for example you have the following data....

Apple
Apple
Orange
Apple
Banana
Banana
Orange
Apple
Apple
Orange
Orange
Grape Fruit
Banana
Grape Fruit
Tangerine
Applce
Orange

and you want a dax formula to calculate what % of the total each fruit was? I understand how to do this if the data is is constant but am wondering what it would be for data that changes.. Would it just be a separate row for each total of fruit? The data I have is significant... about 10,000-15,000 rows and 35-40 columns...
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Assuming we are talking DAX / PowerPivot, this is pretty easy:

Fruity Count := COUNTROWS(Fruits)
ALL Fruity Count := CALCULATE([Fruit Count], ALLSELECTED(Fruits))
% of Fruit := DIVIDE([Fruity Count], [ALL Fruity Count])
 
Upvote 0
Sorry for the delayed response. So, I am very new to dax / powerpivot. Are you saying that on the first row under my data from within the powerpivot screen, where you put in your dax formula I put in: "Fruity Count := COUNTROWS(Fruits)" ? and then the next row would be : "ALL Fruity Count := CALCULATE([Fruit Count], ALLSELECTED(Fruits))" and then the third "% of Fruit := DIVIDE([Fruity Count], [ALL Fruity Count])" ? It was giving my an error when I tried that..
 
Upvote 0

Forum statistics

Threads
1,224,136
Messages
6,176,562
Members
452,735
Latest member
CristianCaruceriu

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