DAX Performance Optimization with NOT and COUNTROWS

DP-600 By islever Editorial Last updated

Short answer

B Replacing the DAX line with a logically equivalent NOT and COUNTROWS expression does not reduce execution time.

Question

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 ( CALCULATE ( COUNTROWS ( 'Order Item' ) ) < 0) Does this meet the goal? - Exhibit: DAX Performance Optimization with NOT and COUNTROWS
  1. Yes
  2. No Correct Answer

Key Takeaways

Replacing a DAX filter with a logically equivalent expression using NOT and COUNTROWS does not reduce execution time because the underlying calculation is still evaluated.

Replacing a DAX condition with a logically equivalent expression using NOT and COUNTROWS does not improve query performance. This page confirms that logically equivalent DAX formulations yield the same execution time.

Common mistake: Choosing Yes because the DAX syntax looks different, assuming it triggers a different query plan without verifying logical equivalence.

Expert Analysis

Why the Answer Is Correct

The correct answer is No because the proposed solution replaces the original DAX expression with one that is logically equivalent. Since both expressions must evaluate the same CALCULATE and COUNTROWS operations against the 'Order Item' table, the VertiPaq engine processes the same amount of data and performs the same calculations, resulting in identical execution times.

Why the Other Options Are Wrong

Choosing Yes would incorrectly imply that simply rearranging a DAX condition into a NOT statement inherently optimizes the query. Performance optimization requires reducing the computational workload—such as filtering earlier or using a more efficient function—not just altering the logical syntax without reducing the work.

Community Comment Notes

Community members agree that the change is logically equivalent and thus offers no performance benefit, as Pegooli noted: "This change is logically equivalent to the original condition". Martin_Nbg also pointed out that "Performance would be about the same", reinforcing that syntax shifts without computational reduction do not optimize DAX.

Official Reference

https://learn.microsoft.com/en-us/dax/best-practices-dax

This link opens the official vendor documentation in a new tab.

Exam Strategy

When evaluating DAX optimization solutions, check if the proposed change actually reduces the data scanned or the complexity of the calculation. Logically equivalent expressions will not improve performance.

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 3 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors, not of islever. The comments shown first are the most substantive of the thread — ranked by depth, community endorsement and relevance; expand the list below to read the rest.

From public community threads 3

  1. Pegooli 👍 6 Answered B
    This change is logically equivalent to the original condition and does not optimize the performance.
  2. Martin_Nbg 👍 3
    No is correct. Performance would be about the same.
  3. nappi1 👍 1 Answered B
    The performance must be the same

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All DP-600 Questions

Access 115 questions with complete answers and detailed explanations.

View Full DP-600 Practice Test →

← Back to DP-600 Study Guide