Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PL-300 All Questions

View all questions & answers for the PL-300 exam

Exam PL-300 topic 2 question 63 discussion

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

HOTSPOT
-

You have the Power BI data model shown in the following exhibit.



You need to create a measure to count the number of product categories that had products sold during a selected period.

How should you complete the DAX expression? 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 (?) , you can switch to a simple comment.
Switch to a voting comment New
Sushvij
Highly Voted 1 year, 10 months ago
Wrong Tested, correct answer is Distinctcount('Product'[product category], 'sales'
upvoted 94 times
mybarbie9917
1 year, 10 months ago
I have the feeling that this answer is correct. Can you please explain more details for your test and the result?
upvoted 2 times
...
Inesd
6 months, 1 week ago
But Distinctcount takes one argument which is the column for which you want to apply the function, am I wrong ?
upvoted 1 times
...
kail85
1 year, 10 months ago
Distinctcount would make sense if the column to be counted has duplicates. Not applicable here, so COUNT would be the right answer. Second one would be Date
upvoted 3 times
Abhi_1526
9 months ago
I agree , That is dimension table so no need of having duplicates
upvoted 1 times
...
semauni
1 year, 7 months ago
A product category can be assigned to multiple products, so there is a possibility of duplicates.
upvoted 5 times
cokimon
1 year, 6 months ago
If cat A has product B and product C. If B is sold twice and C is sold 4 times, the total count of cat A sold is 6. So it should be COUNT.
upvoted 1 times
AshND
1 year, 5 months ago
In your example scenario, Cat A should be included in the count of categories having sales. It doesn't matter how much sale it has, the fact that it is present in 'Sales' means that category has some sale and it should be included in the count.
upvoted 2 times
...
...
...
...
eekman
1 year, 10 months ago
That can't be right, DISTINCTCOUNT requires a column as parameter not a table. https://learn.microsoft.com/en-us/dax/distinctcount-function-dax Right answer is: COUNT(Product[ProductCategory],'Date')
upvoted 6 times
semauni
1 year, 7 months ago
But he gave a column as a parameter?
upvoted 10 times
...
...
...
LouStar2
Highly Voted 1 year, 6 months ago
This question was definitely on todays exam
upvoted 22 times
...
jaume
Most Recent 6 days, 14 hours ago
I would vote for DISTINCTCOUNT('Sales'[ProductId]) and filter to be applied to 'Date' (distinct) counting the Product Category in the Product table would return '1' for each category as they are listed only once in that table, aren't they? so we should count (distinctcount) how many times they are listed in the 'Sales" table
upvoted 1 times
...
rcaliandro
3 months, 1 week ago
The correct answer is DISTINCTCOUNT('Product'[ProductCategory]), 'Date'
upvoted 1 times
rcaliandro
3 months ago
Sorry I was wrong the correct answer is DISTINCTCOUNT('Product'[ProductCategory]), Sales). I tested it
upvoted 3 times
...
...
Mo2011
6 months, 2 weeks ago
Tested CategorySoldCount = CALCULATE( DISTINCTCOUNT(Products[ProductCategory]),Sales)
upvoted 2 times
...
ultrxlight
8 months ago
it has to be sales and not date because of the filter flow
upvoted 1 times
...
Elektrolite
8 months, 2 weeks ago
Both Sales and Date passed as a calculate modifier seem unnecessary
upvoted 1 times
...
Dani_eL
9 months, 1 week ago
The question is: the number of product categories that had products sold during a selected period. Tested with data from adventureWorks using: 1 report, 2 cards, 1 slicer card 1 has 'date' card 2 has 'sales' slicer is connected to Date table (using between dates parameters) Using 'Date' will always return all the distinct categories no matter the selected dates in the slicer. Using 'Sales' returns the number of distinct categories sold between the two dates of the slicer correct tested answer is: Distinctcount('Product'[product category], 'sales'
upvoted 12 times
...
jeffbeckinc
9 months, 3 weeks ago
This is a terrible question but I am going to say the posted answer is corrected since there is no cross filter direction in the relationship or DAX to indicate that Sales should be filtered on. The date table has to be connected to the Sales table by the sales date and by using date to filter, you are not using a fact table to filter in the answer. Terrible question, but this is my best attempt to defend the posted answer.
upvoted 1 times
jeffbeckinc
9 months, 3 weeks ago
I would like to withdraw or edit my prior comment. I believe the answer should be DistinctCount, Sales. I did not test it out properly before, when mirroring the model relationship as shown in the question. DISTINCTCOUNT on Sales is the answer I believe
upvoted 2 times
...
...
lukelin08
10 months, 2 weeks ago
correct answer is Distinctcount('Product'[product category], 'sales'
upvoted 4 times
...
applushka
10 months, 2 weeks ago
tested in PBI: Product Categories Sold = CALCULATE(DISTINCTCOUNT('Product'[ProductCategory]), Sales) will return count of categories sold per selected time period
upvoted 3 times
...
odyash
1 year ago
Answer: CALCULATE(DISTINCTCOUNT('Product'[ProductCategory]), 'Sales') Explanation (my attempt): "to count num. of prod. categories" -> DISTINCTCOUNT('Product'[ProductCategory]) "had products sold" -> therefore, we want the filter to be the table sales, so that if a product ID is not found in sales table, then this ID's product category will not be counted in DISTINCTCOUNT "during a selected period" -> I think this means we can "select" the desired period from a slicer in the report's page, or in the **Filters** pane, so this filter will automatically propagate to this DAX formula.
upvoted 6 times
[Removed]
10 months ago
Can you please explain why filtering by Sales table is working? The filter is directed from Product to Sales table, and the filter context won't be able to go in the opposite direction.
upvoted 2 times
...
AdrianBalescu
11 months, 2 weeks ago
perfect explanation
upvoted 2 times
...
...
RMUK
1 year, 1 month ago
Distinctcount('Product'[product category], 'Date'
upvoted 2 times
AdrianBalescu
11 months, 2 weeks ago
it is 'Sales' not Date'
upvoted 3 times
...
...
sunkkki
1 year, 2 months ago
I was wondering why it should be 'Sales,' not 'Date,' but here's chat GPT's explanation. Product Categories Sold = CALCULATE( DISTINCTCOUNT(Product[ProductCategory]), Date ) what this formula does: - It counts the distinct product categories from the 'Product' table. - The filter context is based on the 'Date' table, meaning the calculation will consider only the dates that are currently selected or visible in your report. In short, it has nothing to do with Sales, which is not what we want.
upvoted 2 times
tranquanghuy2111
1 year, 1 month ago
chat GPT is totally wrong. Assuming we have another FACT table called STOCK. in this fact table we do have relationship with Product and Date. so if we use DATE not SALES, how power BI can calculate and distinguish the point "products sold during a selected period" with "products in stock during a selected period
upvoted 6 times
tranquanghuy2111
1 year, 1 month ago
so we need to add SALES here, not DATE
upvoted 3 times
...
...
...
MEG_Florida
1 year, 3 months ago
Distinctcount('Product'[product category], 'sales' For those saying Count, it cannot be count. Yes the words they use are give us the count of categories in this period. But they mean Distinct, it has too. If you have Categories A B C And selling stuff like A bike A chain B wheel There are only 2 categories. Now 3. If you do a count now you said 3... But there will never be 3 categories its 1 and 1 with a duplicate... = 2. And sales not Date, because date has a 1 - Many relationship with Sales. so if you do a count on Date, you could end up with more than you expected as it would include duplicate categories from sales to cover the dates of those sales.
upvoted 8 times
...
kayani29
1 year, 4 months ago
The answer should be: Distinctcount('Product'[product category], 'sales' as the question clearly states: product categories that had products sold during a "selected period" so the period is already selected.
upvoted 6 times
...
JJMC5544
1 year, 4 months ago
DISTINCTCOUNT ( 'Product' [ProductCategory] ), 'Sales' - Context Transition thanks to CALCULATE
upvoted 4 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 ...