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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
TristanO
New Member

Grouping Data from one column to create graph

Hi All,

 

I am attempting to create a pie graph to show management how many hours are being billed out by each department but in order to do that I need to group together multiple job codes that are in the same column of a table.

 

Below is an example of part of the table -

 

Job CodeHours
EL-2350664
EL-2351554
EL-2352362
EL-235323
ME-123423
ME-1235326
ME-123662
AT-776235
AT-7763235
AT-7764636
O-503352
O-50463
O-505363

 

Basically what I want to do is set a filter that will group AT, EL, ME and O into their own groups and add the hours then create a pie graph that has the 4 created groups.

 

Because this data source is constantly updated I need the filter in place because new job codes are always being added.

 

Is there a way to do this from within Power BI Desktop?

 

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@TristanO,

Create a column using DAX below in your  table.
GroupName = LEFT(Table[Job Code],FIND("-",Table[Job Code])-1)

Then create a pie chart as follows. When new job codes are added, just click "Refresh" button in Power BI Desktop to bring the new data.
1.JPG

Regards,
Lydia

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

You may also split data in the Query Editor window by using - as a delimiter.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@TristanO,

Create a column using DAX below in your  table.
GroupName = LEFT(Table[Job Code],FIND("-",Table[Job Code])-1)

Then create a pie chart as follows. When new job codes are added, just click "Refresh" button in Power BI Desktop to bring the new data.
1.JPG

Regards,
Lydia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.