exam questions

Exam PL-300 All Questions

View all questions & answers for the PL-300 exam

Exam PL-300 topic 2 question 92 discussion

Actual exam question from Microsoft's PL-300
Question #: 92
Topic #: 2
[All PL-300 Questions]

HOTSPOT -

You have a Power BI semantic model that contains a table named Item. The Item table contains a column named Quantity.

You need to create a DAX query that meets the following requirements:

• The rank of items must be calculated according to the values in Quantity.
• Ranking must NOT be skipped if two or more items have the same value in Quantity.
• If an item is unfiltered, the total of Quantity must display a blank value.

How should you complete the DAX formula? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
[Removed]
Highly Voted 9 months, 2 weeks ago
HASONEVALUE ('Item'[Item]) check if 'item' is filtered to a single value. if not, it returns blank by default. Rank method : DENSE ensure that ranks are not skipped when there are ties.
upvoted 8 times
sroumi
2 months, 3 weeks ago
SELECTEDVALUE returns the actual value of the column if there is exactly one unique value, or it returns an alternate result (or BLANK) if there isn’t—its focus is on extracting a value, not simply checking whether there is exactly one. HASONEVALUE is designed purely as a Boolean check. It returns TRUE if there is exactly one distinct value and FALSE otherwise, which is precisely what you need for controlling the logic (calculate rank for a single item, BLANK for totals).
upvoted 1 times
...
...
Lulu_2022
Most Recent 2 weeks, 1 day ago
it will return a blank when no single item is selected — for example, in a total row or when multiple items are in context. That’s exactly what HASONEVALUE() is designed to do: it checks whether the current filter context contains only one distinct value for Item[ItemID]. If not, the IF statement skips the RANKX() and returns blank. This is useful when you want to suppress totals or avoid showing misleading rankings when multiple items are visible. If you’d prefer to show something else (like “N/A” or a default rank) instead of blank, I can help you tweak the logic. Want to explore that?
upvoted 1 times
...
0f4908c
5 months ago
Selected Value Example = SELECTEDVALUE(Products[ProductName], BLANK()) ? HASONEVALUE need IF
upvoted 1 times
...
jaume
7 months, 3 weeks ago
RANKX(<table>, <expression>[, <value>[, <order>[, <ties>]]]) <expression> to evaluate for ranking (within the <table>) <value> is optional; if omitted, current row's value in <expression> is used <order> (optional) to set sort order (ASC, DESC) <ties> is also optional and determines how ties are handled SKIP: skips rank for ties (e.g ranks 1,2,2,4) DENSE does not skip ranks for ties (e.g. ranks 1,2,2,3)
upvoted 1 times
...
hatem.ayed
10 months ago
HASONEVALUE garantiza que la fórmula se ejecute únicamente cuando haya un solo valor de Item seleccionado. Esto evita que se devuelva un valor de clasificación cuando no se ha seleccionado ningún elemento, cumpliendo con el requisito de mostrar un valor en blanco si no se ha filtrado ningún elemento. DENSE se asegura de que, si dos o más elementos tienen la misma cantidad, no se omitan números en la clasificación, lo cual era otro de los requisitos.
upvoted 4 times
...
nelrosell
10 months, 1 week ago
Correct Answer: HASONEVALUE, DENSE
upvoted 4 times
...
nammm112
10 months, 1 week ago
Wrong. It should be HASONEVALUE and DENSE
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...