0
0
Power BIbi_tool~20 mins

Unpivoting columns in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Unpivoting Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
DAX to Unpivot Sales Data by Region

You have a table SalesData with columns: Product, North, South, East, West. Each region column contains sales numbers.

Which DAX expression correctly unpivots the regional sales into two columns: Region and Sales?

AUNPIVOT(SalesData, SalesData[North], SalesData[South], SalesData[East], SalesData[West])
BUNION(SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "North", "Sales", SalesData[North]), SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "South", "Sales", SalesData[South]), SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "East", "Sales", SalesData[East]), SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "West", "Sales", SalesData[West]))
CSELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", {"North", "South", "East", "West"}, "Sales", {SalesData[North], SalesData[South], SalesData[East], SalesData[West]})
DSUMMARIZE(SalesData, SalesData[Product], "Region", SalesData[North] & SalesData[South] & SalesData[East] & SalesData[West])
Attempts:
2 left
💡 Hint

Think about stacking rows for each region using SELECTCOLUMNS and UNION.

visualization
intermediate
1:30remaining
Best Visualization After Unpivoting Sales Data

After unpivoting regional sales data into Region and Sales columns, which visualization best shows sales comparison across regions for each product?

APie chart showing total sales per product
BLine chart with Region on X-axis and Product as legend
CStacked bar chart with Product on X-axis, Sales on Y-axis, and Region as legend
DTable showing Product, Region, and Sales columns
Attempts:
2 left
💡 Hint

Think about comparing sales by region side by side for each product.

data_modeling
advanced
2:30remaining
Data Model Design for Unpivoted Sales Data

You have unpivoted sales data with columns: Product, Region, and Sales. You want to create a data model that supports filtering by region and product category.

Which modeling approach is best?

ACreate separate dimension tables for Product and Region, and link them to the unpivoted sales fact table
BKeep all data in a single flat table without relationships
CCreate a dimension table only for Product and keep Region as a column in the fact table
DCreate a dimension table only for Region and keep Product as a column in the fact table
Attempts:
2 left
💡 Hint

Think about how to enable flexible filtering and reduce data duplication.

🔧 Formula Fix
advanced
2:00remaining
Identify the Error in Unpivoting DAX Expression

Consider this DAX expression intended to unpivot sales columns:

UNION(
  SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "North", "Sales", SalesData[North]),
  SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "South", SalesData[South]),
  SELECTCOLUMNS(SalesData, "Product", SalesData[Product], "Region", "East", "Sales", SalesData[East])
)

What is the error in this expression?

ASalesData table is not referenced correctly
BUNION cannot combine more than two tables
CSELECTCOLUMNS cannot be used with string literals
DMissing the "Sales" column name in the second SELECTCOLUMNS call
Attempts:
2 left
💡 Hint

Check the column names in each SELECTCOLUMNS call carefully.

🧠 Conceptual
expert
3:00remaining
Why Unpivoting Columns Improves BI Analysis

Why is unpivoting columns into rows often recommended before creating reports and dashboards in BI tools?

AIt converts wide data into a normalized format, enabling easier aggregation, filtering, and visualization
BIt reduces the total number of rows, improving performance
CIt automatically creates calculated columns for each original column
DIt eliminates the need for dimension tables in the data model
Attempts:
2 left
💡 Hint

Think about how BI tools handle data for filtering and grouping.