0
0
Power BIbi_tool~10 mins

Sorting data in Power BI - Interactive Code Practice

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

Complete the code to sort the 'Sales' column in ascending order using DAX.

Power BI
SortedSales = SORT(SalesTable, SalesTable[Sales], [1])
Drag options to blanks, or click blank then click option'
ATOPN
BASC
CFILTER
DDESC
Attempts:
3 left
💡 Hint
Common Mistakes
Using DESC instead of ASC will sort in descending order.
Using TOPN or FILTER are not sorting directions.
2fill in blank
medium

Complete the code to sort the 'Date' column in descending order in a Power BI table visual.

Power BI
TableVisual.SortByColumn = 'Date' [1]
Drag options to blanks, or click blank then click option'
AORDER
BASC
CSORT
DDESC
Attempts:
3 left
💡 Hint
Common Mistakes
Using ASC will sort dates from oldest to newest.
SORT and ORDER are not valid sorting directions here.
3fill in blank
hard

Fix the error in the DAX formula to sort 'Product' by 'Category' in ascending order.

Power BI
SortedProducts = SORT('ProductTable', 'ProductTable'[[1]], ASC)
Drag options to blanks, or click blank then click option'
ACategory
BProduct
CSales
DDate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Product' instead of 'Category' will sort by product names, not categories.
Using 'Sales' or 'Date' will sort by wrong columns.
4fill in blank
hard

Fill both blanks to create a calculated table sorted by 'Region' ascending and 'Sales' descending.

Power BI
SortedTable = SORTBY('SalesData', 'SalesData'[[1]], [2], 'SalesData'[Sales], DESC)
Drag options to blanks, or click blank then click option'
ARegion
BSales
CASC
DDESC
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Sales' in the first blank sorts by sales first, not region.
Using DESC for 'Region' will sort regions in reverse alphabetical order.
5fill in blank
hard

Fill all three blanks to create a measure that returns the top 5 products sorted by 'TotalSales' descending.

Power BI
TopProducts = TOPN(5, 'ProductSales', 'ProductSales'[[1]], [2], 'ProductSales'[[3]])
Drag options to blanks, or click blank then click option'
ATotalSales
BDESC
CProductName
DASC
Attempts:
3 left
💡 Hint
Common Mistakes
Using ASC instead of DESC will return the lowest sales products.
Using 'ProductName' as the first sort column will not sort by sales.
Leaving the third blank empty causes errors.