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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
KathyO
Frequent Visitor

Counting repairs undertaken to create a pie graph

Hi there

 

I have a table of data which looks like this:

KathyO_0-1729720878374.png

And I simply want to create a pie graph which shows the number of times we have undertaken each repair, e.g. Sharp edge removal = 10, Wheel repair = 11, Welding = 2, Greasing = 1

 

How do I do that?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.

Hello,@KathyO .I am glad to help you.
As lbendlin suggested, using inverse pivot is indeed a very good way to make the data more readable!
I'd like to suggest some additional suggestions below, which I hope will be helpful to you.

suggestion1.
Create measures directly.


vjtianmsft_0-1729819420220.png

 

 

Count_Creasing = CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Creasing"))



Count_Welding = CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Welding"))


Count_Wheel repair = CALCULATE(COUNT('Table'[Repairs undertaken.1]),FILTER(ALL('Table'),'Table'[Repairs undertaken.1]="Wheel repair"))

 

Put the measures to the pie graph.

suggestion2.
If your real data does match the screenshot you've shown, it's a good idea to create a table of calculations to visualize the results.

vjtianmsft_1-1729819546678.png

create calculate columns to count values

vjtianmsft_0-1729819865911.png

 

 

Table 2 = 
VAR _a = SELECTCOLUMNS(FILTER('Table','Table'[Repairs undertaken.1] = "Wheel repair"),"a",'Table'[Repairs undertaken.1])
VAR _b = SELECTCOLUMNS(FILTER('Table','Table'[Repairs undertaken.2]<>BLANK()),"a",'Table'[Repairs undertaken.2])
VAR _c = UNION(SUMMARIZECOLUMNS('Table'[Repairs undertaken.1],_a),SUMMARIZECOLUMNS('Table'[Repairs undertaken.2],_b))
RETURN
_c

 

 

 

values = 
 SWITCH(TRUE(),
 'Table 2'[Repairs undertaken.1]="Wheel repair",CALCULATE(COUNT('Table'[Repairs undertaken.1]),FILTER(ALL('Table'),'Table'[Repairs undertaken.1]="Wheel repair")),
 'Table 2'[Repairs undertaken.1]="Creasing",CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Creasing")),
 'Table 2'[Repairs undertaken.1]="Welding",CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Welding"))
 )

 

I've uploaded the corresponding pbix file, hope it helps.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,lbendlin ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.

Hello,@KathyO .I am glad to help you.
As lbendlin suggested, using inverse pivot is indeed a very good way to make the data more readable!
I'd like to suggest some additional suggestions below, which I hope will be helpful to you.

suggestion1.
Create measures directly.


vjtianmsft_0-1729819420220.png

 

 

Count_Creasing = CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Creasing"))



Count_Welding = CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Welding"))


Count_Wheel repair = CALCULATE(COUNT('Table'[Repairs undertaken.1]),FILTER(ALL('Table'),'Table'[Repairs undertaken.1]="Wheel repair"))

 

Put the measures to the pie graph.

suggestion2.
If your real data does match the screenshot you've shown, it's a good idea to create a table of calculations to visualize the results.

vjtianmsft_1-1729819546678.png

create calculate columns to count values

vjtianmsft_0-1729819865911.png

 

 

Table 2 = 
VAR _a = SELECTCOLUMNS(FILTER('Table','Table'[Repairs undertaken.1] = "Wheel repair"),"a",'Table'[Repairs undertaken.1])
VAR _b = SELECTCOLUMNS(FILTER('Table','Table'[Repairs undertaken.2]<>BLANK()),"a",'Table'[Repairs undertaken.2])
VAR _c = UNION(SUMMARIZECOLUMNS('Table'[Repairs undertaken.1],_a),SUMMARIZECOLUMNS('Table'[Repairs undertaken.2],_b))
RETURN
_c

 

 

 

values = 
 SWITCH(TRUE(),
 'Table 2'[Repairs undertaken.1]="Wheel repair",CALCULATE(COUNT('Table'[Repairs undertaken.1]),FILTER(ALL('Table'),'Table'[Repairs undertaken.1]="Wheel repair")),
 'Table 2'[Repairs undertaken.1]="Creasing",CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Creasing")),
 'Table 2'[Repairs undertaken.1]="Welding",CALCULATE(COUNT('Table'[Repairs undertaken.2]),FILTER(ALL('Table'),'Table'[Repairs undertaken.2]="Welding"))
 )

 

I've uploaded the corresponding pbix file, hope it helps.

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Why would you think a pie chart is an appropriate representation of the story you are trying to tell with the data?

 

Unpivot your source data to bring it into a usable format, then the chart type of your choice will "just work".

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.