Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to remove duplicate with if else condition

Hi all,

 

Want to ask how can I remove duplicate with if else condition? Do it have some formula for that?

 

Current data

 

 

Data that I want it to be view in powerbi

 

 

 

I try to remove duplicate the usage (unit) but there will be a possibility that the usage (unit) have same value on different day. (in this case 9 & 10).

So my idea is = if production order have duplicate value then remove duplicate usage (unit)

 

Any help?

 

Regards,

Nuha

 

 

 

7 Replies

  • Can you explain more which rows you expect to drop or keep and why?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi stenford23 ,

       

      I want to drop the yellow highlighted row and remain the not highlighted row.

      Because as you can see in the red highlighted data is different.

       

       

      Regards,

      Nuha

      • stenford23's avatar
        stenford23
        Helper I

         

         

        Table.Distinct(
            Table.Buffer(
        		Table.Sort(
                   original_table,
        		   {"End Time", Order.Ascending}
        		)
        	), {"Usage (Unit)}"
        )

         

         

        Sort by End date (add start date also if you need it), Buffer it (otherwise it won't work) and get distinct.