You have data in several text files, altogether three reports, each of them contains 100 lines. The structure is the same in all the three reports: sales representative, product and sales volume.



Note, that the data is in line with header row, even though file looks bit skewed.
What is the total sales volume for each product ?
We could find this out by copy pasting three reports into one Excel sheet and placing pivot on top of the combined sheet.
However, sales volume by product can be calculated with power pivot.
First, we need add them all to worksheet’s data model.
As the files are in one folder C:\BI, we can transfer the whole folder to data model.

Select data – get data – from file – from folder.

Browse the correct path.

Press Transform data.

The combined files are listed.

Press combine files -button with two arrows downwards in content column.

Looks ok, press ok.

All 300 lines are included.

Select Close & Load – Close & Load to.

Select only create connection and activate add this data to the data model. Press ok.

The queries and connections. Also BI-folder with 300 records is included.
If you don’t see this box, select data – queries & connections.

Select Power Pivot – Manage to see the data model.

Data is there.

Before we dive into Power Pivot, we could create a measure for the sum of sales.

DAX is short =sum(BI[Sales]) . Format is whole number as sales is not a decimal number.

Time for pivot: take insert – pivot table.

We use worksheet’s data model as the source data.

Source.Name is a new field, which is the file name either one.txt, two.txt or three.txt. Take product as rows and sales total as values.

The result.
Of course, you can append text files manually, and then run normal pivot.

Append manually three files into one.

Use the range as the source data.


The result is the same with traditional pivot.
Combining files from folder into data model took more time than traditional pivot. If you had twenty text files each containing 10000 rows, that would take long time to combine all manually. Also manual process increases the possibility for human error.
Data model makes it possible to create relationships between tables and expand report.
If you can download the data with separate files with same structure, it is not an issue for power pivot reporting.


















