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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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