Power BI Script
Power BI Script
The Power Query Editor you see here is the interface we will use to edit our data sources. You can easily
edit all the data sources you added to Power BI under the Queries section. The Power Query Editor has
functions such as removing columns and rows, splitting columns, combining data source, changing data
types and filtering data in columns.
Data visualization
This is the data visualization interface. We can easily select a visual from the icons under the build visual
section. And display data in the visual by dragging the data fields to these sections. The line chart has a
particular function called the tool tip, which is an information box which displays the y-axis data at a
particular x-axis point. The tool tip appears when you hover your mouse across the line chart. Hence, if
you would not like to directly display information in the line chart, you can add it in the tool tip section.
We can also easily change the visual used to display the data. Simply click the visual you would like to
change it to.
Visuals on the same page can also interaction with each other. If you click the Asia column in the column
chart. Correspondingly, only the Asia line graph is shown in the line chart
Formatting
Under ‘Format Visuals’, we can format various aspects of the visual. For example, the axis, legend, the
graph lines. Some functions under format visual are changing the color, size and text font or changing
the range of the axis values.
Hierarchies
We can also display hierarchies in visuals by adding the data we would like to see in the hierarchy to the
data field box. As shown, the hierarchy allows us to display both the population in each country and
population in each region in one visual. Different hierarchy levels can also interact with each other. For
example, if we select the Asia column in this hierarchy level, we can see only Asian countries are
displayed in the other hierarchy level.
Slicers
We can filter the data we would like to display in visuals without changing the data in the data sources.
There are 2 methods to do this. The first method is to use slicers, which is the left visuals. By inputting
the regions data field to the slicer, this allows us to control the regions displayed in the line chart.
Filters
Internal
The second method is to use the filters located here. Under this section, we can basic filtering allows us
to filter by selection, advanced filtering which uses filter expressions, and top N filtering which visualizes
the high and lowest data. There are also different levels on filters. Filter
DAX Function
We can calculate data using DAX functions. To perform DAX functions, go to ‘Data View’. This is the
interface used to perform DAX functions. There are 2 DAX functions. They are called ‘Calculate Data’ and
‘Measure Data’. I will demonstrate the difference between these 2 functions using an example. For
example, we would like to calculate the total revenue of revenue A and revenue B. If we used ‘Calculate
Data’, the function ‘Calculate Data’ will return multiple entries of data as shown in this total revenue
column. If we used ‘Measure Data’, only a single data entry will be returned as shown here.
Internal