0% found this document useful (0 votes)
10 views17 pages

MoI II DAX & Calculated Columns

Learn not DAX works

Uploaded by

allgoodsikki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views17 pages

MoI II DAX & Calculated Columns

Learn not DAX works

Uploaded by

allgoodsikki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

2023/2024

Ms Chouhan
Mr Mollayev
Mr Smeding

MANAGEMENT OF
INFORMATION II
Workshop 6
Content and Learning objectives of today
Content LOs
Explore time-based data / Calculated Create a Date Table
tables / Create a Date Table
Analyze data with DAX / Basic DAX Able to write DAX expressions
functions / Calculated columns / Create
DAX formulas for calculated columns
Prepare a report / tables in Power BI Prepare a Matrix

Homework

Management of Information II
Homework last week

Management of Information II
Working Steps in BI tools

Query Editor Data Model Visualizations


Get data, transform and
(Relationships, DAX) (Dashboard)
load

Management of Information II
DAX overview
Data Analysis Expressions (DAX) is a formula expression language used in Analysis
Services, Power BI, and Power Pivot in Excel.
DAX formulas include functions, operators, and values to perform advanced
calculations and queries on data in related tables and columns in tabular data models.
DAX is essential to creating effective data models.

Excel performs calculations over cells. DAX works on tables and columns, not cells.

DAX formulas are used in measures, calculated columns and calculated tables.

Management of Information II
DAX overview
 There are over 250 functions in
DAX;
 DAX has many common functions
with Excel. However, DAX is much
more powerful than Excel formula;
 DAX functions are combined by
types.

You can see all DAX functions here:


https://docs.microsoft.com/en-us/da
x/dax-function-reference

Management of Information II
DAX data types

DAX supports the following data types:

Management of Information II
DAX operators
To perform basic mathematical operations such as addition, subtraction, or multiplication; combine
numbers; and produce numeric results, use the following arithmetic operators.

Management of Information II
Calculated tables – Date table
You can create a date table by using a DAX function CALENDAR and CALENDARAUTO.
CALENDAR and CALENDARAUTO generate a one-column table of datetime data type called Date.

Management of Information II
Calculated tables – Date table
What does calendarauto do:
CALENDARAUTO function (DAX) - DAX | Microsoft Docs

Why create date table?


• Has a SINGLE record for each and every day
• Has that SINGLE daily record for whatever time period you set
• Allows for data consistency in analysis
• Allows for the usage of DAX for Time-intelligence functions
• Such as Year-over-Year information

Management of Information II
DAX formulas for Calculated
columns
A calculated column is an additional column in a
table that you define with a DAX formula.

example: To get more columns in date table, create


calculated columns for month and year by using
date and time functions of DAX.

Management of Information II
Mark your date table as a date table
Note: Select the date table>right click>Mark as date table>select the date column

Management of Information II
Data Model
Relate your date table to your
central/main table

Management of Information II
Using DAX functions in Calculated
columns
 DAX relational function RELATED
returns a related value from another
table.
 The RELATED function requires that a
regular relationship exists between the
current table and the table with related
information.
 RELATED Can access the one-side from
the many-side because in that case only
one row in the related table exists if Note: Use function RELATED to get data from
any. If no such row exists, RELATED the look up table into the central table and
returns BLANK. calculate total revenue and costs
 If a relationship does not exist, RELATED
raises an error.

Management of Information II
Related table

products sales
productID product price salesID productID date quantity revenue
1 € 14,99 10 2 1-10-2022 2 ?
2 € 21,25 11 2 2-10-2022 3 ?
3 € 39,10 12 1 2-20-2022 1 ?
13 3 3-20-2022 2 ?

Management of Information II
In-class exercises
There are 2 inclass exercise, same company, but different data model
• DAX inclass exercise related
• DAX inclass exercise calculated columns

What are the differences? Advantages/disadvantages?

Management of Information II
Homework
• See brightspace

Management of Information II

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy