Bird
Raised Fist0
Power BIbi_tool~10 mins

Transpose operations in Power BI - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to transpose a table in Power BI using DAX.

Power BI
TransposedTable = TRANSPOSE([1])
Drag options to blanks, or click blank then click option'
ACALCULATE
BSUMMARIZE
CFILTER
DSalesData
Attempts:
3 left
💡 Hint
Common Mistakes
Using aggregation functions like SUMMARIZE inside TRANSPOSE.
Passing a filter expression instead of a table.
2fill in blank
medium

Complete the code to create a transposed table of selected columns.

Power BI
SelectedColumns = SELECTCOLUMNS(SalesData, "Product", Product, "Amount", Amount)
Transposed = TRANSPOSE([1])
Drag options to blanks, or click blank then click option'
ASelectedColumns
BSalesData
CFILTER(SalesData, Amount > 100)
DSUMMARIZE(SalesData, Product)
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to transpose the original table instead of the selected columns.
Using aggregation functions inside TRANSPOSE.
3fill in blank
hard

Fix the error in the code to transpose a filtered table.

Power BI
FilteredTable = FILTER(SalesData, Amount > 50)
TransposedTable = TRANSPOSE([1])
Drag options to blanks, or click blank then click option'
AFILTER(SalesData, Amount > 50)
BFilteredTable
CSUMMARIZE(SalesData, Product)
DCALCULATETABLE(SalesData, Amount > 50)
Attempts:
3 left
💡 Hint
Common Mistakes
Passing FILTER function directly inside TRANSPOSE.
Using aggregation functions instead of tables.
4fill in blank
hard

Fill both blanks to create a transposed summary table grouped by Product and Year.

Power BI
SummaryTable = SUMMARIZE(SalesData, [1], [2], "TotalSales", SUM(Amount))
TransposedSummary = TRANSPOSE(SummaryTable)
Drag options to blanks, or click blank then click option'
ASalesData[Product]
BSalesData[Year]
CAmount
DProduct
Attempts:
3 left
💡 Hint
Common Mistakes
Using measure names like Amount as grouping columns.
Using incomplete column references.
5fill in blank
hard

Fill all three blanks to create a transposed table with filtered and selected columns.

Power BI
Filtered = FILTER(SalesData, [1] > 100)
Selected = SELECTCOLUMNS(Filtered, "Product", [2], "Amount", [3])
Result = TRANSPOSE(Selected)
Drag options to blanks, or click blank then click option'
AAmount
BSalesData[Product]
CSalesData[Amount]
DProduct
Attempts:
3 left
💡 Hint
Common Mistakes
Using partial column names in SELECTCOLUMNS.
Filtering on wrong column names.

Practice

(1/5)
1. What does the Table.Transpose function do in Power BI's Power Query?
easy
A. It flips rows and columns in a table.
B. It filters rows based on a condition.
C. It sorts the table by a specific column.
D. It merges two tables into one.

Solution

  1. Step 1: Understand the function purpose

    Table.Transpose is designed to switch rows and columns in a table.
  2. Step 2: Compare with other options

    Filtering, sorting, and merging are different operations not related to transposing.
  3. Final Answer:

    It flips rows and columns in a table. -> Option A
  4. Quick Check:

    Transpose = Flip rows and columns [OK]
Hint: Transpose means flip rows and columns [OK]
Common Mistakes:
  • Confusing transpose with filtering or sorting
  • Thinking transpose merges tables
  • Assuming transpose deletes data
2. Which of the following is the correct syntax to transpose a table named SalesData in Power Query?
easy
A. Table.Transpose = SalesData
B. Table.Transpose(SalesData)
C. Transpose.Table(SalesData)
D. SalesData.Transpose()

Solution

  1. Step 1: Recall Power Query function syntax

    Functions use the format FunctionName(Parameter). Here, Table.Transpose(SalesData) is correct.
  2. Step 2: Identify incorrect syntax

    Assignment with '=', incorrect function/table order, and object method syntax (.Transpose()) are invalid in Power Query M language.
  3. Final Answer:

    Table.Transpose(SalesData) -> Option B
  4. Quick Check:

    Correct function call = Table.Transpose(SalesData) [OK]
Hint: Use Table.Transpose(tableName) to transpose [OK]
Common Mistakes:
  • Using assignment instead of function call
  • Swapping function and table names
  • Adding parentheses incorrectly
3. Given this table in Power Query:

Product | Jan | Feb
--------|-----|----
A       | 10  | 20
B       | 30  | 40

What will be the first row after applying Table.Transpose?
medium
A. [10, 20, 30]
B. ["Product", "Jan", "Feb"]
C. ["Jan", "Feb", "A"]
D. ["Product", "A", "B"]

Solution

  1. Step 1: Understand transpose effect on rows and columns

    Transpose flips rows and columns, so the first row becomes the first column.
  2. Step 2: Identify first row after transpose

    Original first column is ["Product", "A", "B"], so this becomes the first row after transpose.
  3. Final Answer:

    ["Product", "A", "B"] -> Option D
  4. Quick Check:

    Transpose flips rows and columns correctly [OK]
Hint: First row after transpose = original first column [OK]
Common Mistakes:
  • Confusing rows with columns after transpose
  • Mixing header names with data values
  • Assuming transpose sorts data
4. You wrote Table.Transpose(SalesData) but get an error. Which is the most likely cause?
medium
A. SalesData is not a table but a list or other type.
B. You forgot to import the SalesData table.
C. Table.Transpose requires two parameters.
D. Transpose only works on numeric columns.

Solution

  1. Step 1: Check input type for Table.Transpose

    Table.Transpose requires a table input. If SalesData is not a table, it causes an error.
  2. Step 2: Evaluate other options

    Importing is unrelated to syntax error; function takes one parameter; transpose works on any data type.
  3. Final Answer:

    SalesData is not a table but a list or other type. -> Option A
  4. Quick Check:

    Input must be a table [OK]
Hint: Ensure input is a table, not a list [OK]
Common Mistakes:
  • Passing lists instead of tables
  • Assuming transpose needs multiple parameters
  • Thinking transpose only works on numbers
5. You have monthly sales data with months as columns and products as rows. You want to analyze sales trends by month vertically. Which approach using transpose is best?
hard
A. Sort the table by product name before transposing.
B. Filter the table to show only one month at a time.
C. Use Table.Transpose to flip months into rows, then add an index for sorting.
D. Merge the sales table with a calendar table without transposing.

Solution

  1. Step 1: Understand the data layout and goal

    Months are columns, products are rows. To analyze trends by month vertically, months should become rows.
  2. Step 2: Apply transpose and prepare for analysis

    Using Table.Transpose flips months into rows. Adding an index helps keep months in order for trend analysis.
  3. Step 3: Evaluate other options

    Filtering one month loses trend view; sorting products doesn't help months; merging without transpose doesn't reshape data as needed.
  4. Final Answer:

    Use Table.Transpose to flip months into rows, then add an index for sorting. -> Option C
  5. Quick Check:

    Transpose + index = vertical month analysis [OK]
Hint: Transpose months to rows, add index for order [OK]
Common Mistakes:
  • Not transposing before analysis
  • Filtering instead of reshaping data
  • Ignoring the need to keep month order
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard