0% found this document useful (0 votes)
12 views2 pages

Power BI DAX Programming Questions

The document contains a series of DAX programming questions and answers related to Power BI. It covers topics such as creating calculated columns, measures, and custom tables, along with specific DAX formulas for calculations like Total Sales, running totals, previous month's sales, and Year over Year growth. Additionally, it explains the use of the CALCULATE function and how to count distinct customers and create dynamic titles.

Uploaded by

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

Power BI DAX Programming Questions

The document contains a series of DAX programming questions and answers related to Power BI. It covers topics such as creating calculated columns, measures, and custom tables, along with specific DAX formulas for calculations like Total Sales, running totals, previous month's sales, and Year over Year growth. Additionally, it explains the use of the CALCULATE function and how to count distinct customers and create dynamic titles.

Uploaded by

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

Power BI DAX Programming Questions

with Answers
Section: DAX Programming in Power BI (25 Marks)
 Q1. What is DAX in Power BI and where is it used?

A1. DAX (Data Analysis Expressions) is a formula language used in Power BI to create calculated
columns, measures, and custom tables. It is used to perform calculations on data models.

 Q2. Write a DAX formula to calculate Total Sales from a 'Sales' table.

A2. Total Sales = SUM(Sales[Amount])

 Q3. How do you calculate the running total of sales using DAX?

A3.
Running Total =
CALCULATE(
SUM(Sales[Amount]),
FILTER(
ALL(Sales[Date]),
Sales[Date] <= MAX(Sales[Date])
)
)

 Q4. How to calculate the previous month's sales using DAX?

A4.
Previous Month Sales =
CALCULATE(
SUM(Sales[Amount]),
PREVIOUSMONTH(Sales[Date])
)

 Q5. Create a DAX measure to calculate Year over Year (YoY) growth.

A5.
YoY Growth =
DIVIDE(
[Total Sales] - CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])),
CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))
)

 Q6. Write a DAX formula to get top 5 products by sales.


A6.
Top 5 Sales =
IF(
RANKX(ALL('Products'), [Total Sales]) <= 5, [Total Sales], BLANK()
)

 Q7. What does the CALCULATE function do in DAX?

A7. CALCULATE evaluates an expression in a modified filter context. It is used to override or modify
current filters.

 Q8. How to count distinct customers using DAX?

A8. Distinct Customers = DISTINCTCOUNT(Sales[CustomerID])

 Q9. How to create a dynamic title using DAX in Power BI?

A9.
Title =
"Sales Report for " & MAX('Date'[MonthName]) & " " & MAX('Date'[Year])

 Q10. Write a DAX expression to calculate a conditional column with three grades based on Sales.

A10.
Sales Grade =
SWITCH(
TRUE(),
Sales[Amount] > 100000, "A",
Sales[Amount] > 50000, "B",
"C"
)

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