Search Header Logo
Learn DAX Basics

Learn DAX Basics

Assessment

Presentation

Computers, Professional Development, Other

Professional Development

Hard

Created by

Li Da Gan

Used 5+ times

FREE Resource

6 Slides • 9 Questions

1

Learn DAX Basics

by Li Da Gan

2

Learn DAX Basics

  • ​Data ​Analysis Expressions (DAX)

  • ​A collection of functions, operators and constants that can be used in a formula and expression

  • ​Calculate and return one or more values

  • ​Provide capabilities to solve data modeling and analytical problems

  • ​3 fundamental concepts – Syntax, Functions and Context

  • ​DAX in Power BI

3

Fill in the Blank

DAX stands for ___

4

Syntax

  • Calculated Column​

  • ​E.g. Margin = FactSales[SalesAmount] – FactSales[TotalCost]

  • In the FactSales table, for each row in the Margin calculated column, calculate (=) a value by subtracting (-) values in the [TotalCost] column from values in the [SalesAmount] column

  • Calculated Measure

  • E.g. ​Sum of Sales Amount = SUM(FactSales[SalesAmount])

  • For the measure named Sum of Sales Amount, calculate (=) the SUM of values in the [SalesAmount] column in the FactSales table

5

Multiple Choice

What always surrounds a column name in a DAX formula?

1

Ampersand &

2

Brackets [ ]

3

Parentheses ( )

4

Exclamation !

6

Fill in the Blank

How would you write a formula for the following:

In the DimProduct table, for each row in the UnitMargin calculated column, calculate a value by subtracting values in the UnitCost column from values in the UnitPrice column?

7

​Functions

  • Predefined formulas that perform calculations by using specific arguments, in a particular order or structure

  • Categories: Date and Time, Information, Logical, Mathematical, Statistical, Text, and Time Intelligence Functions

  • DAX functions are unique in the following way:

  • ​Always references a complete column or a table. Use filters to the formula if use only particular values from a table or column

  • Calculations vary by context

  • Many functions return a table rather than a value. The table is not displayed, but is used to provide input to other function

8

Multiple Select

What does a function always reference?

1

Variables

2

Arguments

3

Table

4

Column

9

Multiple Choice

What function would you use to concatenate two text strings into one string?

1

CONCATENATE( ) 

2

VALUE( )

3

CONCATENATEX( )

4

EXACT( )

10

Multiple Choice

Can a formula contain more than one function?

1

YES

2

NO

11

Context

  • ​Row Context

  • ​The current row

  • M​argin = FactSales[SalesAmount] – FactSales[TotalCost]

  • ​Filter Context

  • ​One or more filters applied in a calculation that determines a result or value

  • ​Define a filter using functions such as ALL, RELATED, FILTER, CALCULATE

  • ​SumofSalesAmount = SUM(FactSales[SalesAmount])

  • ​StoreSales = CALCULATE(SUM(DimChannel[Sales]), FILTER(DimChannel, DimChannel[ChannelName]=“Store”))

12

Multiple Select

What are the two types of context?

1

Row

2

Column

3

Filter

4

Group

13

Fill in the Blank

Filter Context : One or more _ in a calculation that determines a single value

14

Multiple Choice

Which part is the context?

StoreSales = CALCULATE(SUM(DimChannel[Sales]), FILTER(DimChannel, DimChannel[ChannelName]=“Store”))

1

StoreSales

2

Sum(DimChannel[Sales])

3

FILTER(DimChannel, DimChannel[ChannelName]=“Store”)

15

Advanced Techniques

Multi-lines DAX formula​

Learn DAX Basics

by Li Da Gan

Show answer

Auto Play

Slide 1 / 15

SLIDE