Creating Unique Country Dimensions in Power Query

PL-300 By islever Editorial Last updated

Short answer

DE Delete the City column and remove duplicates from the Country column to produce a clean list of unique countries for the dimension.

Question

You are creating a query to be used as a Country dimension in a star schema.
A snapshot of the source data is shown in the following table.
Exhibit: Creating Unique Country Dimensions in Power Query
You need to create the dimension. The dimension must contain a list of unique countries.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
  1. Delete the Country column.
  2. Remove duplicates from the table.
  3. Remove duplicates from the City column.
  4. Delete the City column. Correct Answer
  5. Remove duplicates from the Country column. Correct Answer

Key Takeaways

The trap is assuming 'Remove duplicates from the table' suffices; you must delete non-key columns first to meet the specific dimension requirement.

Learn how to build a unique Country dimension in Power BI by deleting irrelevant columns and removing duplicates in Power Query.

Common mistake: Choosing B and E is wrong because removing duplicates from the whole table retains the City column, which violates the scope of a pure Country dimension.

Expert Analysis

To create a Country dimension containing a list of unique countries, the Power Query Editor must be used to refine the source data. The scenario provides a table with two columns: 'Country' and 'City', where multiple cities exist within the same country (e.g., USA appears three times).

The first necessary step is D. Delete the City column. Since the goal is a dimension based solely on countries, retaining the 'City' column introduces unnecessary attributes that do not contribute to the distinctness of the country list. Removing this column simplifies the dataset to only the relevant attribute.

The second necessary step is E. Remove duplicates from the Country column. After isolating the 'Country' column, the data still contains repeated entries for each country. Using the 'Remove Duplicates' function specifically on this column ensures that each country appears exactly once in the final dimension table.

Option B ('Remove duplicates from the table') would also result in unique rows, but it preserves the 'City' column unless explicitly removed afterward. However, since the requirement is strictly a list of unique countries without city granularity, deleting the city column (D) is the precise action to align with the dimension design. Option A is incorrect because deleting the Country column removes the primary key/attribute needed. Option C is incorrect because removing duplicates from the City column does not address the duplication in the Country column itself.

As noted in community discussions, while order might seem flexible, the combination of D and E directly addresses the structural requirements: isolate the attribute and ensure uniqueness. This approach is standard practice in star schema modeling using Power BI.

Exam Strategy

When designing dimensions in Power Query, always strip away non-key columns before deduplicating. Focus on the cardinality required: if you need a single attribute like 'Country', remove related attributes like 'City' first to avoid complex row-level deduplication logic that retains unwanted data.

Frequently Asked Questions

Why not just use 'Remove duplicates from the table'?

While it creates unique rows, it keeps the 'City' column. If the dimension requires only countries, retaining cities adds unnecessary complexity and potential many-to-many relationships.

Does the order of operations matter between deleting and deduplicating?

Technically, both orders yield a unique country list, but best practice is to filter columns first to reduce processing overhead and ensure clarity in the query steps.

Community Votes

D
50%
E
45%
B
5%

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

Discussion 39 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.

From public community threads 30 of 39

  1. MarcoW91PL 👍 43
    DE is correct we only need the countries
  2. AnnaBi 👍 12
    Agree The table has tocontain unique values for "Country" column, so - delete the city column --> in fact this column is not requested - Remove dupicates from the Country column
  3. Tsbki 👍 6
    DB should also be accepted since the table has only one row after deleting City column.
  4. Katsiees 👍 4
    It is DE , and is tested .. u can’t delete duplicated from the whole table as it will counts all duplicates in all columns .. for example if in country column USA has both the same city NY in the city column then removing duplicated from the whole table would work cuz The duplicates are in both columns .. but in this case duplicates are only in country column therefore is better to remove duplicates in the country column only not whole table then delete city column
  5. gomathi_1991 👍 4
    DE will work in whichever order it is executed. But, DB will give expected result only if D is executed first. As the order of execution is open ended in this question, I'd say DE would be the better answer.
Show 25 more comments
  1. junaid2107 👍 4
    DB is also correct, removing the City column table only has 1 column so removing duplicates from table also works
  2. cs3122 👍 4
    DE is correct, but feel like BD could also work, since it technically does the same thing
  3. omath 👍 3
    Answers: - D. Delete the City column. For a Country dimension, you only need the Country attribute. Remove other attributes (like City) so they don’t affect distinctness. - E. Remove duplicates from the Country column. After keeping only Country, use Remove Duplicates on that column to get a unique list of countries. Why not the others? - A. Delete the Country column → You’d lose the very attribute you need. - B. Remove duplicates from the table → This only removes fully identical rows. If the same country appears with different cities, duplicates won’t be removed. - C. Remove duplicates from the City column → Irrelevant; you need uniqueness by Country, not by City.
  4. LuluSkyy 👍 3
    We all need the dimension to contain the list of unique countries. so we delete the city column because we don't need it and remove the duplicates from the country column. The correct answer is DE
  5. Shalaleh 👍 3
    Because the Dim table is for country, countries should be unique and we need them we cannot remove the country column.
  6. 4b88f2d 👍 2
    I'm not sure why you need E answer. They tell every answer is a part of solution. In the moment y firstly delete city column, you don't need specifically remove Country column, because is the only column you have, so B answer would be correct. Furthermore, as SOF_SH said: "Remove duplicate from a specific column does Not exist in Power BI, the action that does exist is Remove Duplicates." Tricky question, I'm not sure honestly.
  7. Mi4as 👍 2
    DE or ED give you absolutely the same result. I hate questions like this because the test has only one correct answer :( Even more, "delete the city column" and "remove duplicates from the table" (step: Table.Distinct) it still correct. So, we have three correct answers.
  8. RazaTheLegend 👍 2
    Agree The table has to contain unique values for "Country" column, so - delete the city column --> in fact this column is not even requested - Remove dupicates from the Country column
  9. SOF_SH 👍 2
    Remove duplicate from a specific column does Not exist in Power BI, the action that does exist is Remove Duplicates.
  10. 2ae8739 👍 2
    not B, unless the order D --> B is considered. As two seperate actions are requested: DE
  11. StressFree 👍 2
    It was so easy that I was suspicious...
  12. daviduzo 👍 2
    one could say it was stress free
  13. BP215 👍 2
    DE is the right answer
  14. TrustMyAnswers 👍 2
    D and E are correct.
  15. Igetmyrole 👍 1
    B & E are the correct answers. B. Remove duplicates from the table: this action will ensure that only unique rows (combinations of Country and City) remain in the table, effectively removing any duplicate countries. E. Remove duplicates from the country column: This action specifically removes duplicates from the "Country" column, ensuring that we have a list of unique countries. B & E actions, when performing in sequence, will give you a dimension with a list of unique countries, which is what we need for the star schema.
  16. cvviswanath7 👍 1
    The solution requires Unique values for the Country column from the given table. Steps to be taken: 1. Remove all the other columns present (In this case, the City column). These columns are not needed for the dimension table being created, as stated in the question. Option D 2. Now we are left with the Country column which has duplicate values. We now remove the duplicates from this column. Option E
  17. Mi4as 👍 1
    Finally, a full explanation of why only DE is correct and no option for B. Only with DE option no need to think about ordering. I checked the E option and received the unique list of countries at this step. This means it doesn't matter whether we delete the city column before or after deduplication rather than B which may have effect only after E.
  18. Rayen_BF 👍 1
    Correct answers are D and E, as they mentionned in the question, the need to create a "list of unique countries" so it will not make sense in removing only duplicates from country and leaving a column of uncompleted cities, so it's necessary to delete this column.
  19. olalekanadedoyin 👍 1
    DE is correct. We need just the country's column. Remove duplicates from the country's column and delete the city column to enhance performance.
  20. rcaliandro 👍 1
    DE is correct we first remove the city column than we remove duplicates from the Country column
  21. lilval 👍 1
    DE and DA both works, after deleting the city column, just the country column stays
  22. gulutulu 👍 1
    CONFUSING OPTIONS....BEST OPTION IS NEWCOUNTRY=ALLNOBLANKROW(COUNTRY[COUNTRY])
  23. MissElla 👍 1
    First take off tthe table City column then Remove duplicate from Country cell
  24. 2pado 👍 1
    Because the excercise is only asking you to have a list of unique countries
  25. chloezh 👍 1
    Only keep country dimension so remove city and duplication of country

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.

Practice All PL-300 Questions

Access 116 questions with complete answers and detailed explanations.

View Full PL-300 Practice Test →

← Back to PL-300 Study Guide