Power BI - Transferring less structured data
765 views
Oct 18, 2024
Power BI - Transferring less structured data Watch more Videos at https://www.tutorialspoint.com/videotutorials/index.htm Lecture By: Mr. Akshay Magre, Tutorials Point India Private Limited
View Video Transcript
0:00
Hello friends and welcome to Tutorials Point
0:03
In this segment of the video we are going to see the transformation of less
0:07
structure data in Power BI desktop. Now so far you must have got the idea that Power BI desktop is all about order
0:15
and organized data structure. What do I mean by that? Whenever I import any kind of data, I always make sure that the column should have the
0:24
proper data types. So let's take for an example, if it's a date, I should always follow the date
0:29
data types. If it's a text, it should follow text and if it is a time it should follow
0:34
time data types. That's right. So this is what the organized data structure is all about
0:39
Now whenever I want to make any kind of changes or whenever I want to change the data types
0:44
of the table that we have imported, we always need to go to the Power Query Editor
0:49
In Power Query Editor, I can make the transformation the way I wanted. In that, I can reorder the
0:55
column, I can delete the column, I can give the data types and I can get a
1:00
organize data all together in the power query editor. Now in this power query editor
1:05
whenever we apply any kind of changes these changes can be seen on the
1:10
extreme right side of your screen under the applied step section. Under that
1:15
applied section you can see the each and every move that you make and it's
1:19
been recorded every time. Now let's take for an example that sometimes you
1:23
tend to do some mistake. You must have applied some wrong data sets. So what we
1:28
can do about it do a control Z no we do not have an option for undo that is
1:34
control Z in power via instead of that what we can do we can go to that applied
1:39
step section and the step that you have applied you simply have to hover your
1:43
mouse and at the end of it you will find a cross sign over it you simply have to
1:48
click on that cross sign and that changes can be undowed like that so how to
1:53
apply this transformation and how to get our organized data will be having a
1:58
better understanding of this in our practical approach hello friends and welcome in
2:04
this video we are going to learn how to transform a less structure data into a
2:09
structure format in such a way that the report generation in power BI becomes an
2:15
easy task all right so let's go ahead and get started off now in order to
2:19
transform the data we'll be using a new example for this time because
2:25
we'll starting right from the scratch and see how the transformation take place so let me show you the data that we are going to
2:33
transform quickly all right so this will be the data that we be working on now as you can see on your screen this is an Excel spreadsheet in which I have different cities
2:45
all together and I also have the revenue that they have generated in bikes
2:51
in axiaries and miscellaneous with respect to different years okay so as you can
2:57
see this is years and these are the revenue that they have generated for
3:02
each and every city all right so this is the data that will be working on now let's go ahead and
3:09
import this Excel sheet into our power BI desktop and let's go ahead and
3:15
add the transformation okay so let me quickly go to the power BI screen all
3:22
right so we are back to our power BI module now in this particular desktop we
3:26
will be going under edit query sections so that the power query editor comes up
3:31
and under this we have to import the data 建 order to import the data we have to go under the new source right now if you
3:39
click on this drop-down menu the very first thing which we can see is this
3:43
Excel tab so if you simply click on this Excel tab this is this file that we have
3:47
been searching for that is the multi-level spreadsheet I will simply click on it and
3:51
hit open the moment I hit open the navigator tool opens up or this pop-up
3:59
window comes into picture in which we have to select this sheet one which is the
4:03
data that will be transforming all right now you can see this is all the data that
4:09
which we were seeing on our Excel sheet as well I will simply hit okay now the
4:17
moment I hit okay you can see this is this data that has been imported from our
4:22
Excel sheet the way it can be seen out there as well okay now as you can see there
4:27
are some null values because there were few cells which were empty which has been
4:31
represented as null okay so we will will transform this less structure data into a structure format so in order to
4:38
transform this the very first thing which I will be doing is that I will go under
4:43
the transform tab and under the transform tab I will transpose this data the moment
4:49
I click on this transpose data see what happens now as we know transpose is nothing
4:54
but switching rows and columns that's what transpose does so it has exactly done the
4:59
same thing it has switched the column into different rows so this
5:03
these cities can be seen in different columns now it can be seen in different
5:08
rows in this power BI query editor all right the next thing that we have to do
5:13
is I have to give this column names this column some names aligned to it so in order to do that what we will be doing I will simply go on the extreme left side of your data
5:27
and I'll simply right click on it the moment I right click on it these are the
5:32
all changes that you can apply to this table but as of now what we'll be doing we
5:37
need to apply some headers so I will say that use the first row as header of this
5:42
particular table the moment you click on this as you can see now this 2005 2006 these are my different years which has been
5:51
applied as headers and right below it you can see the revenue also you can see
5:56
the column one has all the cities into it okay now let's go ahead and remove this
6:01
null as well so what I want is basically this null should be replaced by the city
6:06
name so I will be using a fill option which can be seen under the transform
6:11
tab itself under transform tab you have this fill drop-down menu if you can simply click on this I have down and up basically what is this fill
6:20
drop-down menu it is similar to the flash fill that we have in our Excel Microsoft
6:27
Excel as well so let me show you how what happens when I click on this down
6:31
button the moment I click on this down you see all the null has been replaced by the
6:37
city above it so it is very simple so you simply have to go here and simply select
6:42
the down button the moment you click on it you have now a structure data altogether let's go ahead and change the column name of
6:49
this so I will simply double click on the column names and name this as cities okay
6:54
I simply hit enter I have the city names also I have this as different categories
7:00
so I'll simply double click on it and name this as categories okay so I'll just
7:06
name it as category as of now okay now this looks a little bit structure manner
7:10
now the only thing which I want to do the changes is I want to
7:14
to convert these column headers into a vertical format in such a way like let me
7:21
explain you these are my different number of years and these are the revenue
7:27
generated by it with respect to different categories now what we'll be doing
7:32
instead of having so many columns will be just having two columns in which the
7:36
first column will tell you the number of years and the next the next column
7:41
which will be next to it will show you what is the revenue
7:44
along with it So what we are going to do is we will going to select all these together So I pressing the control key and selecting it one by one So this is in a pivoted format What we have to do is unpivoted in such a way that it looks like a tabular format so again I will go under the transform tab and I will simply
8:05
click on unpivoted columns the moment I click on unpivoted columns you can see
8:11
now the table has been changed in such a way that this is showing me number of
8:15
years as of now it is showing attributes so I'll simply double-click it and I will name this as years all right I hit enter
8:24
and these are my values right now this is nothing but the revenue all right and I'll
8:32
simply hit enter so this is now into a more structure format in such a way that I
8:37
have number of years and I have the revenue as well also I'll be going under the
8:41
home tab and changing this into a whole number all right so basically I've changed the
8:47
data type out here into a whole number now it seems like a structure data I
8:52
I will simply close and apply the changes and get back to our main X the power BI screen
8:59
It will take some time as it is applying the changes. Alright, now as you can see, we have this sheet which is being a, this is the query that we were working on
9:12
Now these are the different category. We have categories, graph, and the revenue. So if I just simply select any graph, let's say a normal column chart in which I will
9:22
want the city names all right I have the city names and I want to check how much is
9:29
the revenue along with it so I'll simply drag these two headers it says revenues
9:35
by cities altogether it's working so out here you can see this is the three different
9:40
cities that we were working on and the revenue along with it okay we can also create
9:45
a new report let's say a map report basically so I will simply go ahead under this
9:51
geographical condition a film map I want to create a film map so I'll simply click on this so now I
9:57
have all the categories so I have Seattle you have Vancouver and we have
10:02
Portland and what is the revenue as you can see we have dropped the cities and
10:07
we have dropped the revenue so it is giving me the information similarly if you want to go for a pie chart right so it is showing you all the different cities so
10:15
this is how you can transform your data in such a way that the report
10:20
generation in our power BI CSEC screen becomes an easier task isn't it simple guys okay so this is how it is done
10:28
and how this is how you generate a report in power BI okay guys so this was
10:35
all about this video hopefully you like this video see you until next time
#Business & Productivity Software