exam questions

Exam DP-600 All Questions

View all questions & answers for the DP-600 exam

Exam DP-600 topic 1 question 108 discussion

Actual exam question from Microsoft's DP-600
Question #: 108
Topic #: 1
[All DP-600 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have a Fabric tenant that contains a semantic model named Model1.

You discover that the following query performs slowly against Model1.



You need to reduce the execution time of the query.

Solution: You replace line 4 by using the following code:

NOT ISEMPTY ( CALCULATETABLE ( 'Order Item ' ) )

Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
282b85d
Highly Voted 7 months ago
Selected Answer: A
The original query uses the COUNTROWS function inside a CALCULATE function to count the number of rows in the 'Order Item' table. This approach can be inefficient because it involves counting rows even if just one row exists, which might be resource-intensive especially with large datasets. The suggested solution NOT ISEMPTY ( CALCULATETABLE ( 'Order Item' ) ) simplifies the logic to check if the 'Order Item' table related to the customer is empty or not. This approach can be faster as it stops as soon as it finds one row, rather than counting all rows.
upvoted 14 times
...
nappi1
Most Recent 6 months, 1 week ago
Selected Answer: A
Thinking about the option in SQL-like terms, we filter out the customers without the need for an aggregation step, but by using a boolean condition after a join. Aggregations are generally one of the most computationally intensive operations, so I expect the performance to diverge as the fact table grows. Indeed, when running the DAX code, the SQL queries executed by the PBI engine underneath are: ***DAX CALCULATE( COUNTROWS( Sales ) ) > 0 ***SQL SELECT 'Customer'[Customer Name], COUNT ( ) FROM 'Order Item' LEFT OUTER JOIN 'Customer' ON 'Order Item'[CustomerKey]='Customer'[CustomerKey]; ***DAX NOT ISEMPTY( CALCULATETABLE( Sales ) ) ***SQL SELECT 'Customer'[Customer Name] FROM 'Order Item' LEFT OUTER JOIN 'Customer' ON 'Order Item'[CustomerKey]='Customer'[CustomerKey];
upvoted 1 times
nappi1
6 months, 1 week ago
as shown in DAX Studio under "Server Timings" --> "Query".
upvoted 2 times
...
...
stilferx
7 months, 3 weeks ago
IMHO, YES, Because IS NOT EMPTY replicates the logic
upvoted 1 times
...
bigdave987
7 months, 4 weeks ago
Selected Answer: A
Yes. Answer is correct. CALCULATETABLE will accept the row context for each of the rows returned by VALUES, and in turn NOT ISEMPTY will check if the calculated table has rows. This is like using EXISTS in T-SQL. It will check if any rows exists, but doesn't return rows, thus improving performance.
upvoted 3 times
...
klashxx
8 months ago
A — The proposed solution improves efficiency by reducing the number of calculations required. Instead of counting all the rows for each customer and then checking if the count is greater than zero, it simply checks if there are any rows at all, which requires fewer computational resources and execution time
upvoted 2 times
...
dp600
8 months, 1 week ago
Selected Answer: A
It's correct, it returns the ones with values (not isempty).
upvoted 2 times
...
Test_1132
8 months, 1 week ago
what if order item is negative?
upvoted 1 times
Test_1132
8 months, 1 week ago
oh nvm it is count LOL Sorry
upvoted 1 times
...
...
hello2tomoki
8 months, 1 week ago
Selected Answer: A
Yes, replacing CALCULATE ( COUNTROWS( 'Order Item' ) ) > 0 with NOT ISEMPTY ( CALCULATETABLE ( 'Order Item ' ) ) should reduce the execution time of the query. It is a simpler, more meaningful, and faster way to check if a table is empty. https://www.sqlbi.com/articles/check-empty-table-condition-with-dax/
upvoted 4 times
...
andrewkravchuk97
8 months, 2 weeks ago
answer is correct. its faster because it only needs to check if at least one row exists that meets the filter criteria, rather than counting all rows that do.
upvoted 2 times
...
neoverma
8 months, 4 weeks ago
Selected Answer: B
isnt the syntax incorrect? NOT(ISEMPTY(Calculate ... there should be a ( after NOT
upvoted 4 times
nappi1
6 months, 1 week ago
NOT in DAX can be used without parenthesis. NOT ISEMPTY() = NOT(ISEMPTY) as well as TRUE = TRUE()
upvoted 1 times
...
neoverma
8 months, 4 weeks ago
https://learn.microsoft.com/en-us/dax/isempty-function-dax#example
upvoted 2 times
...
Lucetmi
8 months, 2 weeks ago
It's not mandatory, so I'd answer Yes. Ps: CALCULATETABLE triggers context transition so it's crucial to use it this example.
upvoted 1 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 ...