Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
CLEARIFY
Helper I
Helper I

pie chart based upon frequency of measure

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:

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.

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

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

 

 

View solution in original post

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

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

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors