Bird
0
0

You want to filter the Orders table to include only rows where Status is "Completed" and the OrderDate is in 2023. Which DAX expression correctly applies this filter?

hard📝 Scenario Q9 of 15
Power BI - Power Query Editor

You want to filter the Orders table to include only rows where Status is "Completed" and the OrderDate is in 2023. Which DAX expression correctly applies this filter?

AFILTER(Orders, Orders[Status] = "Completed" && YEAR(Orders[OrderDate]) = 2023)
BFILTER(Orders, Orders[Status] = Completed && YEAR(Orders[OrderDate]) = 2023)
CFILTER(Orders, Orders[Status] = "Completed" || YEAR(Orders[OrderDate]) = 2023)
DFILTER(Orders, Orders[Status] = "Completed" && Orders[OrderDate] = 2023)
Step-by-Step Solution
Solution:
  1. Step 1: Check text value syntax

    Status must be compared to "Completed" with quotes.
  2. Step 2: Use YEAR function to filter year 2023

    YEAR(Orders[OrderDate]) = 2023 correctly filters dates in 2023.
  3. Step 3: Combine conditions with AND (&&)

    Both conditions must be true, so use &&.
  4. Final Answer:

    FILTER(Orders, Orders[Status] = "Completed" && YEAR(Orders[OrderDate]) = 2023) -> Option A
  5. Quick Check:

    Use YEAR() and && with quoted text for filtering [OK]
Quick Trick: Use YEAR() to filter dates by year and quote text values [OK]
Common Mistakes:
  • Forgetting quotes around text
  • Using || instead of &&
  • Comparing date column directly to year number

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Power BI Quizzes