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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

How to prepare data when there are multiple items in 1 field

Hi. I need to create a stacked bar chart of items sold per month; however, the data presented to me came with all the data in a single field. Any advice on how to get this into the correct format? 

 

ex.

Date                    Order #   / Item

2018-01-01         / 1           / Hamburger, Fries, Soda

2018-01-01         / 2           / Fries, Shake

2018-01-02         / 3           / Hamburger, Soda

2018-01-02         / 4           / Hamburger

 

On my report, I need to show that on

Jan 01, I sold 1 Hamburger, 2 Friest, 1 Soda, 1 Shake

Jan 02, I sold 2 Hamburgers, 1 Soda

 

Thanks!

 

 

 

 

 

2 ACCEPTED SOLUTIONS
pawel1
Skilled Sharer
Skilled Sharer

 You want your SalesTable look like this:Capture3.JPG

1. Use Query Editor to re-format your source data.  Steps:

- Split Colums by Delimiter /

- Split Columns by Delimiter ,

- Unpivot the last 3 columns (with Items)

- Adjust Data Type, etc

 

 

2. Add a measure 

Count Items = COUNTROWS(SalesTable)

 

3. Visualize with Matrix or other chart Capture4.JPG

 

 

 

View solution in original post

v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

By the way, you may select Split into Rows directly.

Community Support Team _ Sam Zha
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

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

By the way, you may select Split into Rows directly.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I've created the extra columns and it works...to a degree. I can't build charts that show % of Grand Total (because each column has it's own Grand Total). I tried creating a Grand Total of all items sold; however, I can't seem to get a % of Grand Total view still (could be a simple calc that I'm missing).  My example was very simple. What if instead of months, it was a unique reference number (order #)?  e.g. 10001, 10002, 10003 and the item sold had various items in the one field?  And there millions of orders generated monthly?  Thanks!

pawel1
Skilled Sharer
Skilled Sharer

 You want your SalesTable look like this:Capture3.JPG

1. Use Query Editor to re-format your source data.  Steps:

- Split Colums by Delimiter /

- Split Columns by Delimiter ,

- Unpivot the last 3 columns (with Items)

- Adjust Data Type, etc

 

 

2. Add a measure 

Count Items = COUNTROWS(SalesTable)

 

3. Visualize with Matrix or other chart Capture4.JPG

 

 

 

@pawel1this worked great.
I was missing the upivot columns - cheers!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.