Model Data in Power BI: Angeles University Foundation College of Computer Studies
Model Data in Power BI: Angeles University Foundation College of Computer Studies
You'll also create your own custom calculations and assign new metrics
to view specific segments of your data.
How To Manage
Your
Data Relationships
How to manage your data relationships
In the Model view, notice that a block represents each table and its
columns and that lines between them represent relationships.
How to manage your data relationships
To hide a table or individual column from your report, right-click the table
or column in the Model view and select Hide in report view.
How to manage your data relationships
By default, you will set relationships to cross-filter in both directions. Cross-filtering in just one direction limits
some of the modeling capabilities in a relationship.
Setting accurate relationships between your data allows you to create complex calculations across multiple
data elements.
Create calculated columns
For example, to create a relationship with unique fields in data, you can create a new calculated column for
"CountryZip" by combining the values from the Country and the Zip columns.
Create calculated columns
To create a calculated column, select the Data view in Power BI Desktop from the
left side of the report canvas.
Create calculated columns
From the Modeling tab, select New Column to enable the formula bar. You can enter calculations by using
Data Analysis Expressions (DAX) language. DAX is a powerful formula language, also found in Excel, that
lets you build robust calculations. As you type a formula, Power BI Desktop displays matching formulas or
data elements to assist and accelerate the creation of your formula.
The Power BI formula bar will suggest specific DAX functions and related data columns as you enter your
expression.
Create calculated columns
After you have created the calculated columns in each table, they can be used as a unique key to establish
a relationship between them. By going to the Relationship view, you can then drag the field from one table
to the other to create the relationship.
Create calculated columns
When you return to the Report view, notice that a different value for each district shows.
Optimize
Data Models
Hide fields
If you view tables in the Model view, hidden fields appear dimmed. The data in these tables is still available
and is still part of the model. You can unhide any field that has been hidden by right-clicking the field and
then selecting unhide.
Sort visualization data by another field
As a common example, data that includes the name of the month is sorted alphabetically by
default, for example, August would appear before February.
Sort visualization data by another field
In this case, selecting the field in the Fields list, selecting Sort by Column from the Modeling
tab, and then choosing a field to sort by can remedy the problem. The MonthNo category sort
option will order the months as intended.
Setting the data type for a field is another way to optimize your information so that it's handled correctly. To
change a data type from the report canvas, select the column in the Fields pane, and then use the Format
drop-down menu to select one of the formatting options. Any visuals you've created that display that field are
updated automatically.
Create
Calculated
Measures
Create a measure
To create a measure, in Report view, select New Measure from the Modeling tab.
Create a measure
From the Formula bar, you can enter the DAX expression that defines your measure. As you
enter your calculation, Power BI suggests relevant DAX functions and data fields. You'll also
receive a tooltip that explains some of the syntax and function parameters.
Create a measure
If your calculation is long, you can add extra line breaks in the Expression Editor by typing
ALT-Enter.
Apply a measure
After you've created a new measure, it will appear in one of the tables
on the Fields pane, which is found on the right side of the screen.
Power BI inserts the new measure into whichever table you have
currently selected. While it doesn't matter, exactly, where the measure
is located in your data, you can easily move it by selecting the measure
and using the Home Table drop-down menu.
You can use a measure like any other table column: just drag and drop it onto the report canvas or
visualization fields. Measures also integrate seamlessly with slicers, segmenting your data on the fly, which
means that you can define a measure once and then use it in many different visualizations.
Create
Calculated
Tables
Create calculated tables
After the new table has been created, you can use your calculated table as you would any other table in
relationships, formulas, and reports.
Explore
Time-based Data
Explore time-based data
When you create a table visualization in your report by using a date field, Power BI Desktop
automatically includes breakdowns by time period. For example, the single date field in
the Date table was automatically separated into Year, Quarter, Month, and Day by Power BI.
Explore time-based data
When you select the bars or lines in your chart, the system will drill
down to the next level of time hierarchy, for example, from years to
quarters. You can continue to drill down until you reach the most
granular level of the hierarchy: days. To move back up through the
time hierarchy, select Drill Up in the top, left-hand corner of the
visual.
You can also drill down through all the data that is shown on the
visual instead of through one selected period. To do so, use the Go
to the next level in the hierarchy double-arrow icon.
As long as your model has a date field, Power BI will automatically generate different views for different time
hierarchies.
END
By: Jewel Anne R. Atanacio