Data Analysis Expressions (DAX) is a powerful formula language used in Power BI to perform data modeling, analysis, and complex calculations. Learn the fundamentals of DAX, basic calculations, aggregation functions, and conditional columns with these 30 multiple-choice questions (MCQs).
Introduction to Data Analysis Expressions (DAX)
What does DAX stand for in Power BI? a) Data Analysis Expressions b) Data Analytics Execution c) Data Access Extensions d) Data Arrangement Expressions
DAX is primarily used in which Power BI component? a) Visualizations b) Query Editor c) Data Model d) Power Query
Which of the following is a DAX function for creating calculated columns? a) SUM b) AVERAGE c) CALCULATE d) IF
In DAX, which of the following is used to calculate dynamic results based on user selections? a) Measures b) Calculated columns c) Aggregations d) Slicers
Which of these is NOT a type of DAX expression? a) Calculated Column b) Measure c) Table expression d) Visual expression
Basic Calculations and Measures
What is the difference between a calculated column and a measure in DAX? a) A calculated column is evaluated at the row level, while a measure is evaluated at the filter context level. b) A measure is evaluated at the row level, while a calculated column is evaluated at the filter context level. c) Both are evaluated at the same level d) Neither supports filtering
Which DAX function would you use to sum a column of values in Power BI? a) AVERAGE b) COUNT c) SUM d) MAX
What is the result of the following DAX formula: =SUM(Sales[Revenue])? a) Total sum of all columns in Sales table b) Count of the number of rows in Sales c) Total sum of the “Revenue” column in Sales d) Maximum value from the “Revenue” column
How do you create a new measure in Power BI using DAX? a) Select “New Measure” from the ribbon b) Use the “New Table” option c) Write a formula in Power Query d) Use the “Calculated Column” function
In Power BI, which of the following is the primary function of a measure? a) Perform calculations based on the current filter context b) Create new columns for better visualization c) Filter data for use in Power Query d) Sort data in descending order
Aggregation Functions (SUM, AVERAGE, etc.)
Which DAX function calculates the average of a column in Power BI? a) AVERAGE b) SUM c) COUNT d) MAX
What does the DAX function COUNTROWS do? a) Counts the number of columns in a table b) Counts the number of distinct values in a column c) Counts the number of rows in a table d) Calculates the sum of rows in a table
Which DAX function returns the maximum value of a column? a) AVERAGE b) MIN c) SUM d) MAX
If you wanted to calculate the total sales for a product category in Power BI, which DAX function would you use? a) SUM b) AVERAGE c) COUNT d) DIVIDE
What is the purpose of the DISTINCTCOUNT function in DAX? a) Count all rows in a table b) Count the number of unique values in a column c) Count all non-null values in a column d) Calculate the average of distinct values
Conditional Columns
What is the use of the DAX IF function in Power BI? a) To conditionally return a value based on logical tests b) To calculate the sum of values in a column c) To filter out empty values in a column d) To remove duplicate rows in a table
Which of the following is the correct syntax for a DAX IF statement? a) IF(condition, true_result, false_result) b) IF(true_result, false_result, condition) c) IF(true_result, condition, false_result) d) IF(condition, false_result, true_result)
How would you create a new column that labels products as “High” or “Low” based on their price using DAX? a) IF([Price] > 100, “High”, “Low”) b) SWITCH([Price], 100, “High”, “Low”) c) SUM([Price]) > 100 d) CALCULATE([Price] > 100)
Which DAX function can be used to evaluate multiple conditions and return values based on those conditions? a) SWITCH b) IFERROR c) AND d) OR
What does the following DAX expression do: IF(Sales[Revenue] > 5000, "Target Met", "Target Not Met")? a) Returns “Target Met” if revenue is greater than 5000; otherwise, “Target Not Met” b) Filters the rows where revenue is greater than 5000 c) Returns a sum of all revenues greater than 5000 d) Returns “Target Met” for all rows
Advanced DAX Functions
Which function would you use to calculate the running total of sales in DAX? a) CUMULATIVE b) TOTALYTD c) CUMULATESUM d) SUMX
How can you calculate year-to-date sales in DAX? a) YTD(Sales[Amount]) b) TOTALYTD(Sales[Amount], Date[Date]) c) SUMYTD(Sales[Amount]) d) AVERAGEYTD(Sales[Amount])
What does the DAX function CALCULATE do? a) Evaluates an expression in a modified filter context b) Creates a new table based on conditions c) Filters rows for aggregation functions d) Returns a table with selected columns
Which of the following DAX functions can be used to filter rows within a measure? a) CALCULATE b) AVERAGE c) COUNTROWS d) DISTINCT
What is the purpose of the FILTER function in DAX? a) To create new tables with calculated columns b) To filter rows based on specified conditions c) To perform aggregations on selected columns d) To remove duplicates from a table
Working with Time Intelligence
Which DAX function calculates the previous month’s sales? a) PREVIOUSMONTH b) LASTMONTH c) SALESINPREVIOUSMONTH d) SALESLASTMONTH
How would you calculate the difference between two dates in DAX? a) DATEDIFF b) DATEADD c) TIMEDIFF d) DATEBETWEEN
What does the DAX function DATEADD do? a) Adds a specified number of time intervals to a date b) Adds dates to a column c) Adds two date columns together d) Creates a new date column
Which function is used to get the last date in a date column in DAX? a) LASTDATE b) MAXDATE c) ENDDATE d) FINALDATE
In DAX, which function can be used to compare sales this year with sales from the previous year? a) SAMEPERIODLASTYEAR b) YEARLYCOMPARE c) PREVYEAR d) LASTYEAR
Answer Key
Qno
Answer
1
a) Data Analysis Expressions
2
c) Data Model
3
d) IF
4
a) Measures
5
d) Visual expression
6
a) A calculated column is evaluated at the row level, while a measure is evaluated at the filter context level.
7
c) SUM
8
c) Total sum of the “Revenue” column in Sales
9
a) Select “New Measure” from the ribbon
10
a) Perform calculations based on the current filter context
11
a) AVERAGE
12
c) Counts the number of rows in a table
13
d) MAX
14
a) SUM
15
b) Count the number of unique values in a column
16
a) To conditionally return a value based on logical tests
17
a) IF(condition, true_result, false_result)
18
a) IF([Price] > 100, “High”, “Low”)
19
a) SWITCH
20
a) Returns “Target Met” if revenue is greater than 5000; otherwise, “Target Not Met”
21
b) TOTALYTD
22
b) TOTALYTD(Sales[Amount], Date[Date])
23
a) Evaluates an expression in a modified filter context
24
a) CALCULATE
25
b) To filter rows based on specified conditions
26
a) PREVIOUSMONTH
27
a) DATEDIFF
28
a) Adds a specified number of time intervals to a date