Power BI: load data without duplicates
When I have a big data, the first thing is to try to not load all of them if possible so if my source has duplicate values, I will remove them but sometimes it is not so simple at it is. In Power Query Editor, I can use the “home -> remove rows -> remove duplicates”:
This function works if all columns have the same values but if it is not the case !!! For instance, I have this table:
With this data, I can remove them based on the low or high number, the first or the last date or a specific word.
Remove duplicates based on number
Click on “add column -> custom column”:
In the popup, change the name if need be and in the formula field, put:
if [argument1] = List.Max(Table.SelectRows(#"XXX", (nodup) => nodup[argument2] = [argument2])[argument1]) then "yes" else null

NOTE:
- For the low number, change “Max” by “Min”
- Replace argument by yours and XXX by the last step name. In my example:

Remove duplicates based on word
Click on “add column -> conditional column”:
In the popup, change the name if need be and based on if I am looking for a word in a sentence or not, fill as in the picture:
- For “status” (the column has the word, for instance “closed”):


- For “description” (the column contains the word, for instance “unix”):


NOTE:
- I can add another condition by clicking on “add clause”
- Since I don’t know how people will write “unix”, I will make the column as case-insensitive with the Text.Lower() function in the formula bar:

Remove duplicates based on date
It is the same process as “remove duplicates based on number”:

Once done, I will click on the expand icon of the “custom” column and click on “remove empty”:
By this way, I will keep and load only data with “yes” and the duplicate ones will be removed and not be loaded. You may be interested about those following articles:
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...






