pie chart based upon frequency of measure

cpv

New Member
Joined
Nov 16, 2010
Messages
4
I would like to create a pie graph that shows the frequency of the number of times a customer has bought, e.g. how many bought 1 time, how many bought 2 times, etc.

The raw information looks like this:
total_orders.png


The total orders is a calculated measure:
Customer Total Orders = CALCULATE(DISTINCTCOUNT('Document Attributes'[Document Transaction Number]),'Document Attributes'[Document Type] = "Invoice"||'Document Attributes'[Document Type] = "Sales Receipt")

Customer names come from a related dimension

It would seem that the calculated measure needs some sort of legend to exist in the pie chart (because it only shows the total number), but I am at a loss here.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I found the answer to my own solution, and wanted to post:

Create a new table by clicking "New Table" under Modeling on Home page and use the formula below.

Customer Order Frequency = SUMMARIZE (Customer, Customer[Customer Name], "Total Orders", CALCULATE ( DISTINCTCOUNT ( 'Document Attributes'[Document Transaction Number] ), 'Document Attributes'[Document Type] = "Invoice" || 'Document Attributes'[Document Type] = "Sales Receipt" ) )

This creates a new table with two columns.

Then Create a pie chart, select the [Total Orders] as Legend, the count(Customer Order Frequency[Customer Name]) as Values level. voila!
 
Upvote 0

Forum statistics

Threads
1,215,149
Messages
6,123,311
Members
449,095
Latest member
Chestertim

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