Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
deb_power123
Helper V
Helper V

Delete rows with duplicate entries in table using DAX or Tranformation

Hi,

I want to get rid of the rows containing Asia,Delhi then Asia,Shimla and Asia,Panjim as region and location in below table and also it has 100 enties like this[with same combination] .

 

Can we have any DAX or trasformation rule to handle this?

Input source table:

RegionlocationAveragemarksSchoolName
AsiaDelhi90ABC
IndiaDelhi90ABC
IndiaChennai85DEF
JapanTokyo88XYZ
AsiaShimla92WEF
IndiaShimla92WEF
AsiaPanjim78LMN
IndiaPanjim78LMN
AsiaGoa66JKL
AsiaHongkong71OPP
AsiaKarachi41LMI



Expected Output:

 

RegionlocationAveragemarksSchoolName
IndiaDelhi90ABC
IndiaChennai85DEF
JapanTokyo88XYZ
IndiaShimla92WEF
IndiaPanjim78LMN
AsiaGoa66JKL
AsiaHongkong71OPP
AsiaKarachi41LMI
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@deb_power123 , Create a flag like this

 

if([region] ="Asia" && [Location] in {"Delhi","Shimla","Panjim"} , 1, 0)

 

You can use that in measure or visual level filter

 

or create a new table

calculatetable(Table, [Flag]=0)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@deb_power123 , Create a flag like this

 

if([region] ="Asia" && [Location] in {"Delhi","Shimla","Panjim"} , 1, 0)

 

You can use that in measure or visual level filter

 

or create a new table

calculatetable(Table, [Flag]=0)

sorry @amitchandak My bad it worked,I added wrong name for column.

Hi @amitchandak  I am not very clear with your approach, I tried the first approach but it shows only filter as 0 in the visual filter and 1 doesnt apprear.So, if 1 is not showing how will I be able to hide the entries for the first condition?Could you please suggest 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors