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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hidenseek9
Post Patron
Post Patron

Merging files with different format and creating a chart

Hi, Power BI Community!

 

I am looking for a solution to below problem and would highly appreciate

the solution to this.

 

I have excel files of prices of a company's product at every store

that they sell at. I have an excel file for each month.

What I would like to do is for Power BI to show

the evolution of prices of each product that the company sells

at every store they sell at.

 

For instance, if I select a brand A at a store 1, I would like to have a chart

that shows the price of a product every month.

 

Please find the sample data below.

Sample Data

 

Here is how to read the files.

Row 1 shows the names of brand (A,B,C,D...)

Row 2 shows the names of product under each brand (ビオDrink脂肪0プレーン加糖, etc.)

Column E (店舗コード) is a store number

Column F (店舗名)is a store name

Column L to the rest of the column is the price that we sell each product at.

 

Essentially, I want to have a chart where X axis is month and Y asix is price.

I want to have a filter visual above the chart so I can filter by brand and by product.

 

The problem that I have is that

1) a number of product that the company sells varies depending on the month so the file format is not always the same.

 

Also, what I would like to do is that

1) Distinctively count the number of stores we sell at (Column F: 店舗名), so that I know how many stores the company sells the product at every month.

 

Much appreciate your support on this.

 

Many thanks,

 

H

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @hidenseek9,

 

The current table structure is not proper to create a chart visual in Power BI. So, please refer to below steps to convert table structure.

 

Insert one row on the top of the excel sheet. Specify column headers as shown in below screenshot. Make this modification to excel file.

1.PNG

 

Then, load all data files into Power BI desktop one by one. Take the "2016 Jan" as an example, locate to Query Editor mode, set the first row as column headers (Transform-> Use first row as headers). Then, filter out some records where the value under [StoreID] in null or "StoreID".

2.PNG

 

Unpivot columns like below:

3.PNG

 

Split column, then rename the new columns with meaningful aliases.

5.PNG

 

Apply all above changes to "2017 May", then, append these two tables. (Home->Append queries->Append queries as new).

9.PNG

 

Save and apply all changes, return back to report view mode. Please check to make sure the [DateTime] is set to date type and [Value] is set to numeric.

6.PNG7.PNG

 

Now, you can insert a line chart into report page, add corresponding fields from the appended table into chart and slicer.

8.PNG

 

I have uploaded the .pbix file for your reference.

 

By the way, please mask sensitive data before uploading.

 

Best regards,
Yuliana Gu

 

Community Support Team _ Yuliana Gu
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
v-yulgu-msft
Employee
Employee

Hi @hidenseek9,

 

The current table structure is not proper to create a chart visual in Power BI. So, please refer to below steps to convert table structure.

 

Insert one row on the top of the excel sheet. Specify column headers as shown in below screenshot. Make this modification to excel file.

1.PNG

 

Then, load all data files into Power BI desktop one by one. Take the "2016 Jan" as an example, locate to Query Editor mode, set the first row as column headers (Transform-> Use first row as headers). Then, filter out some records where the value under [StoreID] in null or "StoreID".

2.PNG

 

Unpivot columns like below:

3.PNG

 

Split column, then rename the new columns with meaningful aliases.

5.PNG

 

Apply all above changes to "2017 May", then, append these two tables. (Home->Append queries->Append queries as new).

9.PNG

 

Save and apply all changes, return back to report view mode. Please check to make sure the [DateTime] is set to date type and [Value] is set to numeric.

6.PNG7.PNG

 

Now, you can insert a line chart into report page, add corresponding fields from the appended table into chart and slicer.

8.PNG

 

I have uploaded the .pbix file for your reference.

 

By the way, please mask sensitive data before uploading.

 

Best regards,
Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft

 

Thank you so much for a thorough explanation step by step.

I will try your way to see if it works!

 

Many thanks,

 

H

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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