exam questions

Exam PL-300 All Questions

View all questions & answers for the PL-300 exam

Exam PL-300 topic 2 question 54 discussion

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

DRAG DROP
-

You have a Power BI data model that contains two tables named Products and Sales.

A one-to-many relationship exists between the tables.

You have a report that contains a report-level filter for Products.

You need to create a measure that will return the percent of total sales for each product. The measure must respect the report-level filter when calculating the total.

How should you complete the DAX measure? To answer, drag the appropriate DAX functions to the correct targets. Each function may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.

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
GuerreiroJunior
Highly Voted 2 years, 2 months ago
Incorrect answer. 1.Calculate 2. ALLSELECTED. ALLSELECTED Removes only the filter on the expression visual but respect all external filters.
upvoted 118 times
Leon333
1 year, 11 months ago
ALLSELECTED is correct. ALLSELECTED: Returns all the rows in a table, or all the values in a column, ignoring any filters that may have been applied inside the query, but keeping filters that come from the outside. https://mitchellpearson.com/2020/09/14/understanding-row-context-in-dax-and-power-bi/#:~:text=ALLSELECTED%20DAX%20functions,coming%20from%20the%20inner%20query.
upvoted 10 times
SylUK
3 weeks ago
Correct. This function (ALLSELECTED) is different from ALL() because it retains all filters explicitly set within the query, and it retains all context filters other than row and column filters.
upvoted 1 times
...
...
lrodriguezc
2 years ago
ALLSELECTED IS WRONG. THE CORRECT ANSWER IS ALL, BECAUSE WE NEED THE TOTAL SALES IN DIVISOR, AND ONLY FILTERED PRODUCTS IN NUMERATOR. I TESTED IN POWER BI AND ALL WORKS FINE FOR ME.
upvoted 24 times
semauni
1 year, 10 months ago
No, ALL() will remove the report filter
upvoted 21 times
Mabuse1
1 year, 7 months ago
that what he's doing in order to get all sales. Have you even tried what you're saying?
upvoted 2 times
EwoutBI
1 year, 7 months ago
ALL indeed removes/disregards the report filter. I tried both in one table, and the ALL option gave lower percentages for Products than the ALLSELECTED way, because ALL considers all Products while calculating the percentage.
upvoted 2 times
Abhi_1526
1 year ago
All is not good if you want to have some filters
upvoted 1 times
...
...
...
...
...
ManuelG00
1 year, 8 months ago
Correct.
upvoted 2 times
...
...
romer0
Highly Voted 2 years ago
The tricky thing here is that the report contains a report-level filter for Products and you need to calculate all sales (for all products) for the divisor. So I'll share here both functions definition from dax.guide: ALLSELECTED: Returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied inside the query, but keeping filters that come from outside. ALL: Returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. So, for me the correct answer is CALCULATE & ALL
upvoted 30 times
VGG2001
1 year, 8 months ago
I think you are wrong, the answer should be "ALLSelected" instead of "ALL". Lets think about the difference here: "ALLSelected" takes consider of external filter (here we have a report-level filter as we are filtering products to check their sales percentage), while "ALL" ingnores all filters. I also tested out a toy dataset in Power BI. Say I have four products, each makes up 25% of total sales. If we use "ALL" DAX and choose product A&B in the filter, we will see A and B both make up 25% of total sales, but instead what we want is "ALLSELECT" DAX which gives us A and B both makes up 50% of total sales, this meets the question requirement of "respect the report-level filter".
upvoted 11 times
...
Heyzzzzzzzzzzzzzz
2 years ago
"The measure must respect the report-level filter when calculating the total" so shouldn't it be ALLSELECTED?
upvoted 17 times
...
...
5bf040d
Most Recent 4 days, 6 hours ago
CALCULATE ALLSELECTED ALLSELECTED: Retains filters that are explicitly set within the query or report (e.g., slicers, filter visuals, report level filters, Dax filters). It removes only the row and column filters that are part of the current context. ALL: Removes all filters, including those explicitly set in the query or report, and resets the context completely. If you use ALLSELECTED, it will espect the report-level filter (only products data).
upvoted 1 times
...
gpsaran
1 week, 5 days ago
I wonder why so many answers are voted wrong. It should be CALCULATE, ALLSELECTED.
upvoted 1 times
...
hebertorosillo
1 month, 3 weeks ago
Incorrect answer. 1.Calculate 2. ALLSELECTED.
upvoted 1 times
...
jaume
3 months, 4 weeks ago
My vote for CALCULATE and ALLSELECTED. Tricky detail here (it looks like almost all questions have a tricky part) is "The measure must respect the report-level filter when calculating the total". Using ALL option would remove also that report-level filter so we need to use ALLSELECTED
upvoted 2 times
...
nelrosell
6 months, 2 weeks ago
Must be ALLSELECTED as one of the requirements is "The measure must respect the report-level filter when calculating the total" ALL is wrong as it ignores any filters.
upvoted 3 times
...
rcaliandro
6 months, 4 weeks ago
For sure we have: 1 - CALCULATE 2 - ALL or ALLSELECTED but IDK which one :(
upvoted 1 times
...
alyes87
9 months, 2 weeks ago
Use ALL and not ALLSELECTED, as ALL does not respect filters at report level, whereas ALLSELECTED respects them with the exception of the selected column.
upvoted 1 times
...
HenryBiz
10 months, 3 weeks ago
I prefer ALL over ALLSELECTED here because the name of the VAR is for all sales instead of all selected cells, I guess the intention is to have a denominator which includes all products and disregard the visual level filter, so ALL is more appropriate than ALLSELECTED here. By the way, both functions respect page and report-level filter.
upvoted 1 times
...
JudT
11 months, 3 weeks ago
- Calculate - ALLSELECTED Could be: % of productcode sales = VAR productCode = SUM(Sales[Revenue]) VAR AllSales = CALCULATE(SUM(Sales[Revenue]), ALLSELECTED('Product'[Product Code])) RETURN DIVIDE( productCode , AllSales)
upvoted 3 times
...
Feact
12 months ago
All & Allselected are both fine. I'm currently studying for PL-300 and I've been going around for this one... I've just tested it and here's what I've learned. If the function would have been: Calculate(Sales, ........ ('Products')) then ALLSELECTED is 100% the right choice. But since we are filtering only a column ('Products'[Product]) we can use either ALL or ALLSELECTED. Go ahead and test it on a small report, you'll se how it works. I really hope microsoft takes both answers as correct cause I've been thinking and testing for a while to realise about this.
upvoted 2 times
...
Rhugved
1 year ago
Calculate and Allselected because the question is to respect the report level/external filter wile calculating TOTAL SALES. Allselected() helps us to keep visual selected or filter level context
upvoted 1 times
...
DataEngDP
1 year ago
ALLSELECTED is the correct answer,
upvoted 2 times
...
Dani_eL
1 year ago
Based on DAX definitions: ALL :useful for CLEARING filters and creating calculations on all the rows in a table. (https://learn.microsoft.com/en-us/dax/all-function-dax) ALLSELECTED: gets the context that represents all rows and columns in the query, while KEEPING EXPLICIT FILTERS and contexts other than row and column filters. This function can be used to obtain visual totals in queries. (https://learn.microsoft.com/en-us/dax/allselected-function-dax) ALLSELECTED applies to one context(one visual) ALL : if clearing means what it means, you will have no filters anymore So for me : CALCULATE ALLSELECTED
upvoted 3 times
...
SuniltheMentor
1 year, 1 month ago
CALCULATE and ALLSELECTED. Use of all selected will show Sales % based on the selected Products in a Slicer. This is instead of showing sales % across all products
upvoted 2 times
...
Achu24
1 year, 1 month ago
Calculate ,ALL
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago