Bird
0
0

Given this table before unpivoting:

medium📝 dax lod result Q13 of 15
Power BI - Data Cleaning with Power Query
Given this table before unpivoting:
Product | Jan | Feb | Mar
--------|-----|-----|----
A       | 10  | 15  | 20
B       | 5   | 7   | 8

What will be the result after unpivoting the Jan, Feb, Mar columns?
A<pre>Product | Month | Sales --------|-------|------ Jan | A | 10 Feb | A | 15 Mar | A | 20 Jan | B | 5 Feb | B | 7 Mar | B | 8</pre>
B<pre>Product | Jan | Feb | Mar --------|-----|-----|---- A | 10 | 15 | 20 B | 5 | 7 | 8</pre>
C<pre>Product | Attribute | Value --------|-----------|------ A | Jan | 10 A | Feb | 15 A | Mar | 20 B | Jan | 5 B | Feb | 7 B | Mar | 8</pre>
D<pre>Product | Value --------|------ A | 10 A | 15 A | 20 B | 5 B | 7 B | 8</pre>
Step-by-Step Solution
Solution:
  1. Step 1: Understand unpivot output structure

    Unpivoting converts columns Jan, Feb, Mar into rows under a new 'Attribute' column, with their values in 'Value'.
  2. Step 2: Match the correct table format

    Product | Attribute | Value
    --------|-----------|------
    A       | Jan       | 10
    A       | Feb       | 15
    A       | Mar       | 20
    B       | Jan       | 5
    B       | Feb       | 7
    B       | Mar       | 8
    shows Product repeated with each month as 'Attribute' and corresponding values, which matches unpivot output.
  3. Final Answer:

    Table with columns Product, Attribute, Value listing each month as a row. -> Option C
  4. Quick Check:

    Unpivot = Columns to Attribute-Value rows [OK]
Quick Trick: Unpivot creates Attribute and Value columns from selected columns [OK]
Common Mistakes:
  • Thinking unpivot keeps original columns
  • Dropping the attribute column
  • Swapping row and column values incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Power BI Quizzes