I have a table containing 3 million or so transaction records.
I need to find for the unique customer ID’s in this table and generate another table containing all the unique customer ID’s. I need this list to filter out some other data
So, what I’m doing now is duplicating this table, removing all the columns except the Customer ID column and then doing a remove duplicates in Power Query. That does not work for me Power BI never comes back and just spins endlessly with getting the results I wanted. Meaning a table (query) with just my unique Customer ID’s from my 3 million + transaction table.
There must be a better way to get all my unique Customer ID’s from a 3 million + table.
You can create a cal table where you can use function Values and it will do it for you.
Attaching documentation link so you can understand that function
So I got it to work, use List.Distinct as I did on one of my tables, it creates a list., then I converted it to a table.
Open a blank query and type in = List.Distinct(YOURTABLENAMEHERE[YOURCOLUMNNAMEHERE])
This is how my example below looked when complete
let
Source = List.Distinct(ACCOUNT_SUFFIX[#“Account Name”]),
#“Converted to Table” = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#“Converted to Table”
Yes !! This is an important trick. It’s the most efficient way to generate a distinct list of values. I was able to do it before but this trick beats all the useless method I was doing before.
Thank you DavieJoe and others on this forum for your expertise.
No worries @ericet more than happy to help. My M Code knowledge isn’t particularly extensive but lucky for you the issue you were having was something I’d stumbled upon myself not long beforehand.