Méthode 1 :
with cte as(selectrow_number()over (partition by ParentProductCategoryID,Name order by ParentProductCategoryID ) as classement, ParentProductCategoryID,Name from [SalesLT].[ProductCategory] where ParentProductCategoryID is not null)delete from cte where classement >1Méthode 2 :
deletefrom SalesLT.ProductCategory   where ParentProductCategoryID in   (select ParentProductCategoryID from SalesLT.ProductCategory  group by ParentProductCategoryID    having    count(*) >1

![[PowerBI][DAX] – DISTINCTCOUNT() dax powerbi fonction distinctcount](https://i0.wp.com/mybicoach.bwabwanet.fr/wp-content/uploads/2020/03/powerbi-dax-distinctcount.png?resize=100%2C70)


![[PowerBI][DAX] – Comment compter le nombre de ligne d’une table ?](https://i2.wp.com/mybicoach.bwabwanet.fr/wp-content/uploads/2020/01/powerbi-dax-countrows-logo-1.png?resize=100%2C70)
