Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I would like to create a pie graph that shows the frequency of the number of times a customer has 1, 2, 3 orders. etc.
Simple Chart:
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.
Solved! Go to Solution.
Hi @CLEARIFY,
I suggest you create a new table by clicking "New Table" under Modeling on Home page using the formula below.
NewTable = SUMMARIZE ( Table1, "CustomerName", Table[Customer Name], "Total Orders", CALCULATE ( DISTINCTCOUNT ( 'Document Attributes'[Document Transaction Number] ), 'Document Attributes'[Document Type] = "Invoice" || 'Document Attributes'[Document Type] = "Sales Receipt" ) )
You will get a table similar with the screenshot you posted.
Then you can create a pie chart, select the [Total Orders] as Legend, the count(NewTable[CustomerName]) as Values level. You will get expected result.
Best Regards,
Angelia
Hi @CLEARIFY,
I suggest you create a new table by clicking "New Table" under Modeling on Home page using the formula below.
NewTable = SUMMARIZE ( Table1, "CustomerName", Table[Customer Name], "Total Orders", CALCULATE ( DISTINCTCOUNT ( 'Document Attributes'[Document Transaction Number] ), 'Document Attributes'[Document Type] = "Invoice" || 'Document Attributes'[Document Type] = "Sales Receipt" ) )
You will get a table similar with the screenshot you posted.
Then you can create a pie chart, select the [Total Orders] as Legend, the count(NewTable[CustomerName]) as Values level. You will get expected result.
Best Regards,
Angelia
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
84 | |
69 | |
68 | |
39 | |
37 |