0
0
Power BIbi_tool~5 mins

TOPN function in Power BI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the TOPN function do in Power BI?
The TOPN function returns the top N rows of a table based on a specified expression or column, sorted in descending order by default.
Click to reveal answer
beginner
Write the basic syntax of the TOPN function.
TOPN(<N_value>, <table>, <orderBy_expression>[, <order>[, <orderBy_expression>[, <order>]...]]), where N_value is how many rows to return.
Click to reveal answer
intermediate
How can you change the sorting order in TOPN from descending to ascending?
Add the optional <order> argument with the value ASC after the <orderBy_expression> to sort ascending instead of the default DESC.
Click to reveal answer
beginner
What type of value does the TOPN function return?
TOPN returns a table containing the top N rows based on the sorting criteria, not a single value.
Click to reveal answer
intermediate
Can TOPN be used inside other DAX functions? Give an example.
Yes, for example, you can use TOPN inside CALCULATE to filter a table to the top N rows before aggregation.
Click to reveal answer
What does the TOPN function return in Power BI?
AA table with the top N rows
BA single numeric value
CA text string
DA Boolean value
Which argument in TOPN specifies how many rows to return?
A<N_value>
B<orderBy_expression>
C<table>
D<order>
How do you sort the TOPN results in ascending order?
ATOPN always sorts ascending by default
BAdd DESC after the orderBy_expression
CUse the SORT function instead
DAdd ASC after the orderBy_expression
Can TOPN be used inside CALCULATE to filter data?
ANo, TOPN cannot be nested
BYes, to filter to top N rows before aggregation
COnly with numeric columns
DOnly in Power Query, not DAX
What is the default sort order of TOPN if not specified?
ARandom
BAscending
CDescending
DAlphabetical
Explain how the TOPN function works and when you might use it in a Power BI report.
Think about showing best-selling products or top customers.
You got /4 concepts.
    Describe how to change the sorting order in TOPN and why that might be useful.
    Consider when you want to see smallest sales instead of largest.
    You got /3 concepts.