Bird
Raised Fist0
Power BIbi_tool~20 mins

Removing duplicates in Power BI - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Duplicate Remover Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ dax_lod_result
intermediate
2:00remaining
DAX Measure to Count Unique Customers
You have a sales table with multiple rows per customer. Which DAX measure correctly counts the number of unique customers, removing duplicates?
AUnique Customers = COUNT(Sales[CustomerID])
BUnique Customers = COUNTROWS(Sales)
CUnique Customers = SUM(Sales[CustomerID])
DUnique Customers = DISTINCTCOUNT(Sales[CustomerID])
Attempts:
2 left
💡 Hint

Think about which function counts distinct values only.

❓ visualization
intermediate
2:00remaining
Visualizing Unique Product Sales
You want to create a bar chart showing the number of unique products sold per region. Which approach correctly removes duplicates in the visualization?
AUse COUNT(Product[ProductID]) and place Region on axis
BUse COUNTROWS(Sales) and place Region on axis
CUse a measure with DISTINCTCOUNT(Product[ProductID]) and place Region on axis
DUse SUM(Sales[Quantity]) and place Region on axis
Attempts:
2 left
💡 Hint

Counting unique products means counting distinct product IDs.

❓ data_modeling
advanced
2:00remaining
Removing Duplicates in Data Model
You have a table with duplicate customer records. Which Power BI data modeling step removes duplicates before loading data?
AUse Power Query's Remove Duplicates on CustomerID column
BCreate a calculated column with DISTINCTCOUNT(CustomerID)
CApply a filter visual to hide duplicates
DUse a DAX measure with COUNTROWS to filter duplicates
Attempts:
2 left
💡 Hint

Removing duplicates before loading data is done in Power Query.

🔧 Formula Fix
advanced
2:00remaining
Debugging Duplicate Removal in DAX
You wrote this DAX measure to count unique orders but it returns incorrect results with duplicates still counted:

Unique Orders = COUNT(Order[OrderID])

What is the main issue?
Power BI
Unique Orders = COUNT(Order[OrderID])
AOrderID column has blanks causing errors
BCOUNT counts all rows including duplicates; use DISTINCTCOUNT instead
CMeasure syntax is invalid and causes error
DCOUNT only works on numeric columns, OrderID is text
Attempts:
2 left
💡 Hint

Think about which function counts unique values.

🎯 Scenario
expert
3:00remaining
Scenario: Removing Duplicates with Multiple Conditions
You have a sales table with duplicate rows for the same CustomerID and ProductID on the same date. You want to count unique sales transactions ignoring duplicates where CustomerID, ProductID, and Date are the same. Which DAX expression achieves this?
AUnique Sales = COUNTROWS(SUMMARIZE(Sales, Sales[CustomerID], Sales[ProductID], Sales[Date]))
BUnique Sales = DISTINCTCOUNT(Sales[TransactionID])
CUnique Sales = COUNTROWS(Sales)
DUnique Sales = CALCULATE(COUNT(Sales[CustomerID]), ALLEXCEPT(Sales, Sales[CustomerID], Sales[ProductID], Sales[Date]))
Attempts:
2 left
💡 Hint

Summarize groups rows by unique combinations of columns.

Practice

(1/5)
1. What is the main purpose of removing duplicates in Power BI data?
easy
A. To add more rows to the dataset
B. To keep data clean and reliable by eliminating repeated rows
C. To change the data types of columns
D. To create new calculated columns

Solution

  1. Step 1: Understand the concept of duplicates

    Duplicates are repeated rows that can cause errors or confusion in analysis.
  2. Step 2: Purpose of removing duplicates

    Removing duplicates ensures the data is clean and reliable for accurate reporting.
  3. Final Answer:

    To keep data clean and reliable by eliminating repeated rows -> Option B
  4. Quick Check:

    Removing duplicates = Clean data [OK]
Hint: Duplicates cause errors; removing them cleans data fast [OK]
Common Mistakes:
  • Thinking duplicates add useful data
  • Confusing duplicates with data transformation
  • Believing duplicates change data types
2. Which of the following is the correct syntax to remove duplicate rows from a table named Sales in Power Query?
easy
A. Table.RemoveDuplicates(Sales)
B. Remove.Duplicates(Sales)
C. Table.Distinct(Sales)
D. DistinctRows(Sales)

Solution

  1. Step 1: Recall Power Query function for duplicates

    The correct function to remove duplicates is Table.Distinct.
  2. Step 2: Apply function to the table

    Using Table.Distinct(Sales) removes duplicate rows from the Sales table.
  3. Final Answer:

    Table.Distinct(Sales) -> Option C
  4. Quick Check:

    Table.Distinct = Remove duplicates [OK]
Hint: Use Table.Distinct to remove duplicates in Power Query [OK]
Common Mistakes:
  • Using non-existent functions like Remove.Duplicates
  • Confusing syntax with other languages
  • Adding extra parameters unnecessarily
3. Given the table Customers with columns CustomerID and City, what will be the result of Table.Distinct(Customers, {"CustomerID"})?
medium
A. Removes duplicate rows based on all columns
B. Removes duplicate rows based only on City column
C. Returns the original table without changes
D. Removes duplicate rows based only on CustomerID column

Solution

  1. Step 1: Understand Table.Distinct with column list

    When columns are specified, duplicates are removed based on those columns only.
  2. Step 2: Apply to CustomerID column

    Here, duplicates are removed based on CustomerID, ignoring other columns.
  3. Final Answer:

    Removes duplicate rows based only on CustomerID column -> Option D
  4. Quick Check:

    Distinct by columns = Remove duplicates by those columns [OK]
Hint: Specify columns in Table.Distinct to target duplicates [OK]
Common Mistakes:
  • Assuming all columns are checked when columns are specified
  • Confusing column names in the list
  • Thinking it returns unchanged table
4. You wrote Table.Distinct(Sales, "ProductID") to remove duplicates by ProductID but get an error. What is the likely problem?
medium
A. The second argument should be a list of column names, not a single string
B. Table.Distinct does not accept a second argument
C. ProductID column does not exist in Sales table
D. You must use Table.RemoveDuplicates instead

Solution

  1. Step 1: Check Table.Distinct syntax for columns

    The second argument must be a list of column names, e.g., {"ProductID"}, not a string.
  2. Step 2: Identify error cause

    Passing "ProductID" as a string causes a syntax error because it expects a list.
  3. Final Answer:

    The second argument should be a list of column names, not a single string -> Option A
  4. Quick Check:

    Columns argument = List, not string [OK]
Hint: Use curly braces {} for column list in Table.Distinct [OK]
Common Mistakes:
  • Passing column name as string instead of list
  • Using wrong function name
  • Assuming single argument works for columns
5. You have a table Orders with columns OrderID, CustomerID, and OrderDate. You want to keep only the first order per customer by date, removing duplicates of CustomerID but keeping the earliest OrderDate. Which approach is best in Power Query?
hard
A. Sort Orders by OrderDate ascending, then use Table.Distinct(Orders, {"CustomerID"})
B. Use Table.Distinct(Orders, {"CustomerID", "OrderDate"}) without sorting
C. Remove duplicates by OrderID column
D. Filter Orders to keep only rows where OrderDate is max per CustomerID

Solution

  1. Step 1: Sort Orders by OrderDate ascending

    Sorting ensures earliest dates come first for each customer.
  2. Step 2: Remove duplicates by CustomerID

    Using Table.Distinct(Orders, {"CustomerID"}) keeps the first row per customer, which is earliest due to sorting.
  3. Final Answer:

    Sort Orders by OrderDate ascending, then use Table.Distinct(Orders, {"CustomerID"}) -> Option A
  4. Quick Check:

    Sort then distinct = keep earliest per group [OK]
Hint: Sort by date first, then remove duplicates by customer [OK]
Common Mistakes:
  • Removing duplicates without sorting first
  • Including OrderDate in distinct columns
  • Filtering by max date instead of min
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard