0
0
Power BIbi_tool~20 mins

Pivoting columns in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pivoting Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate total sales per product category using pivoted columns

You have a table with sales data pivoted by product categories as columns: Electronics, Clothing, and Furniture. Each column shows sales amount for that category per month.

Which DAX measure correctly calculates the total sales across all categories for each month?

Power BI
SalesData = DATATABLE(
    "Month", STRING,
    "Electronics", INTEGER,
    "Clothing", INTEGER,
    "Furniture", INTEGER,
    {
        {"Jan", 1000, 500, 300},
        {"Feb", 1200, 600, 400}
    }
)

// Choose the correct measure:
ATotal Sales = CALCULATE(SUM(SalesData[Electronics] + SalesData[Clothing] + SalesData[Furniture]))
BTotal Sales = SUMX(SalesData, SalesData[Electronics] * SalesData[Clothing] * SalesData[Furniture])
CTotal Sales = SUM(SalesData[Electronics] + SalesData[Clothing] + SalesData[Furniture])
DTotal Sales = SUM(SalesData[Electronics]) + SUM(SalesData[Clothing]) + SUM(SalesData[Furniture])
Attempts:
2 left
💡 Hint

Think about how to add values from multiple columns correctly.

visualization
intermediate
2:00remaining
Best visualization for pivoted monthly sales data

You have monthly sales data pivoted by product categories as columns. You want to show trends over time for each category clearly.

Which visualization type is best suited for this pivoted data?

ATable showing raw pivoted sales data
BStacked column chart showing months on X-axis and sales on Y-axis with categories stacked
CLine chart with months on X-axis and separate lines for each product category
DPie chart showing total sales per category for all months combined
Attempts:
2 left
💡 Hint

Think about how to show trends over time for multiple categories.

data_modeling
advanced
2:30remaining
Handling pivoted columns in data model for flexible analysis

You receive sales data with product categories as separate columns (pivoted). You want to create a data model that allows easy filtering and aggregation by category.

What is the best approach to handle this pivoted data in your model?

AUnpivot the category columns into two columns: Category and Sales, then relate to a Category table
BKeep the pivoted columns as is and create measures summing each column separately
CCreate calculated columns that concatenate all category sales into one string per row
DRemove all category columns and use only total sales column
Attempts:
2 left
💡 Hint

Think about how to make filtering by category easier and more scalable.

🔧 Formula Fix
advanced
2:00remaining
Identify error in DAX measure summing pivoted columns

Given a table with pivoted sales columns: Electronics, Clothing, Furniture, a developer wrote this DAX measure:

Total Sales = SUM(SalesData[Electronics] + SalesData[Clothing] + SalesData[Furniture])

What error will this measure cause when used in a report?

ASyntaxError due to invalid use of SUM with addition inside
BTypeError because SUM expects a single column but receives an expression
CReturns incorrect total because it sums only Electronics column
DNo error, returns correct total sales
Attempts:
2 left
💡 Hint

Consider what the SUM function expects as input.

🧠 Conceptual
expert
3:00remaining
Why unpivoting columns improves BI report performance and flexibility

In a BI project, you receive data with many product categories as separate columns (pivoted). You decide to unpivot these columns into rows before loading into the model.

What are the main benefits of unpivoting pivoted columns in this context?

AUnpivoting creates a normalized structure that simplifies filtering, aggregation, and reduces the number of measures needed
BUnpivoting reduces data size by removing duplicate values and improves compression
CUnpivoting automatically creates calculated columns for each category, improving calculation speed
DUnpivoting merges all category sales into a single column, which improves visualization options
Attempts:
2 left
💡 Hint

Think about how data structure affects filtering and measure creation.