You have bug in Excel new dynamic unique function

Anonymous
2019-11-04T02:09:18+00:00

Just been figuring out why all results did not match when i first short unique and then sample data in power query. I took me hours to find out that short unique does not short all uniques. I had same text at beginning and then end of cell there where values 2,5 bar, 2,5  bar and

2,5 Bar. Unique values shows 2,5  bar and 2,5 Bar not 2,5 bar. When I change 2,5  bar to 2,5 bar. unique shows only 2,5 bar and 2,5 Bar was wanish. But exsample also same beginning text and value 1,2 bar and 1,2  bar the unigue function returned both values correct. So there must be some kind of bug of that function. I have not checked all but those came up from column witch has 60.000 rows.

Microsoft 365 Insider | Excel | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Oldest
  1. Anonymous
    2019-11-04T18:59:08+00:00

    Please let us know what platform you are using (Mac or Windows), and what version and build of Office you have installed.

    -Jesse

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-11-04T20:22:42+00:00

    Note that UNIQUE is not case sensitive, but Power Query is. So a table that looks like this:

    Data
    1 bar
    2 bar
    3 bar
    2 BAR

    UNIQUE will return:

    1 bar

    2 bar

    3 bar

    but Power Query pulling in that same table, then running a DISTINCT over it will return the following by default:

    1 bar

    2 bar

    3 bar

    2 BAR

    You can tell PQ to be case insensitive by either adding "Comparer.OrdinalIgnoreCase" to your Table.Distinct function, or using Text.Lower (or Text.Upper) to get everything in the same case before running Table.Distinct.

    It isn't a bug, it is just how PQ vs Excel works.

    You could probably get UNIQUE() to be case sensitive by doing some dynamic array magic using the EXACT() function, which is case sensitive. Most Excel functions are not though.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-11-05T00:11:53+00:00

    Hi thank you for your reply.

    I knew that I can solve it in power query, but the problem is that I have hundreds of unique values that I it not possible to short easily  in different categories in PQ. I need to short those values before I send them to PQ that is vital. Your great advise using exact is very interesting. I just don´t know how to use it. I need to google it but if you could advise bit more that I wont have to spend hours try to learn it. My main desire is that I could use it with new array unique function or do I need to study and start write long and complicated function for my purpose using that exact?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-11-05T00:13:40+00:00

    Hello.

    Windows and 365 2016.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-11-05T00:18:26+00:00

    I forgot the reason why I tough it was bug because if I had values 1,2 before that bar and exact same end and then 2,5 at beginning those 1,2 values return with bar correct but those 2,5 did not.

    Was this answer helpful?

    0 comments No comments