0% found this document useful (0 votes)
10 views

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)
10 views

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