Professional Documents
Culture Documents
Business Intelligence Technologies II: CALCULATE Function Continuation
Business Intelligence Technologies II: CALCULATE Function Continuation
The Power BI tool allows you to collect multiple data sources, create complex data models, and interactively visualize results. This
tool is designed for business users, people without serious IT education. The proposed tool capabilities are intuitively deployed and
most actions can be met with the Drag & Drop principle.
An important part of this tool is the programming language of the DAX (Data Analysis eXpressions). With this language, you can
create multiple-level calculations by pulling out the maximum benefit of the proposed data. As any programming language, including
The DAX is highly structured and formalized. It has its own written terms and requirements. The DAX allows three types of
calculations: measurements, columns, tables.
Context: The concept of the DAX language, which describes a rule that the formula must take into account when calculating. Most
common contexts specifies which data from the columns should be used.
Filter context. The most common context used in Power BI. A filter is any value that limits the outcome of a specific calculation. A
basic report that shows sales by regions uses regions as a filter criteria for the calculation "Sales". When creating a Power BI report
each visual becomes a filter and as such also participates in the filter context that affects the calculation result. Filter context determines
which part of a table to use in a calculation. In Excel this would limit the amount of rows in the original table and then perform the
calculation on the remaining rows that match the filter criteria. Filter criteria can come from multiple tables if there are relationships
between them.
Query context – a combination of row and filter context. The most import context to understand when working with DAX and what
determines the end result for calculations.
CALCULATE() function is the only DAX function that can modify the query context. Change the existing rules or add new ones.
Lesson plan
This week we learn the CALCULATE function. We’ll try to understand how it works and try to find use cases.
Task 1
Create relationships between table. Create a place to store measure. Create a dimension table for countries.
Task 3 ( +1 point )
Think about visualization in each report. Try a number of visuals and the capabilities they provide. Think about the general visual idea.
Things like readability (letter size, readable content), placement of visuals and technical capabilities (buttons, tooltips etc.) will be the
main points that determine if the submission gets the extra point for formatting.
Task 4 ( +1 point )
Create a report for each client groups weight % comparison. You have to compare groups weight for the clients from the selected
country agaisnt the total weight. Solve this task using two solutions – one with REMOVEFILTERS and the other with TREATAS.
KUNDENR Internal client code to link BOOK_NR Unique number for each Bill
of Lading in
NAVN Client Name
VAREPOST_NR Row count on Container Nr
level
CONT_ANT Units
CONT_TYPE
CONT_NR
BRUTTO
TARA
TRP_MADE1 Full or Empty (FCL- full,
MTY- empty)
SHORT_DESC Commodity short
description
BOOK