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

DAX to remove duplicate row entries

Hi,

 

For the source table below , I have repeated rows one for India and another for Delhi location .

 

Another for India and Goa location. 

 

I want to hide all those rows with India(marked in bold in the below table) location and want to only keep the rows with Delhi and Goa location .I have many enteries like this so it should be don via some DAX. Please suggest.

 

Source Indput:

SchoollocationAveragemarks
ABCIndia90
ABCDelhi90
DEFIndia89
DEFDelhi89
DEJIndia75
DEJGoa75
DEMIndia97
DEMGoa97

 

Expected Output :

SchoollocationAveragemarks
ABCDelhi90
DEFDelhi89
DEJGoa75
DEMGoa97

 

Kind regards

Sameer

1 ACCEPTED SOLUTION

Hi, @deb_power123 

No dax can identify whether the type of a field is a region or a country.

For the 100 entries for the combinations, you can only consider removing the data by looking for keywords.

Please add a filter measure and apply it to visual filter pane to filter data:

Ex:

Measure = IF(MAX('Table'[Region]) in {"Asia","Europe"},0,1)

or

Measure1 = IF(CONTAINSSTRING(MAX('Table'[Region]),"Asia")||CONTAINSSTRING(MAX('Table'[Region]),"Europe"),0,1)

2.png

Please let me know if I misunderstood.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

5 REPLIES 5
v-easonf-msft
Community Support
Community Support

Hi, @deb_power123 

If you want to use DAX to remove duplicate row entries, @koorosh 's solution could work for you.

1.png

If your problem has been solved, please accept @koorosh's reply as solution to close this thread, so that other community members will easily find the solution when they get the same issue.

 

Best Regards,
Community Support Team _ Eason

I want to get rid of Asia,Delhi then Asia,Shimla and Asia,Panjim in below table and also it has say 100 enties for the combinations .Can we have any DAX or trasformation rule to handle this?

 

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



Hi, @deb_power123 

No dax can identify whether the type of a field is a region or a country.

For the 100 entries for the combinations, you can only consider removing the data by looking for keywords.

Please add a filter measure and apply it to visual filter pane to filter data:

Ex:

Measure = IF(MAX('Table'[Region]) in {"Asia","Europe"},0,1)

or

Measure1 = IF(CONTAINSSTRING(MAX('Table'[Region]),"Asia")||CONTAINSSTRING(MAX('Table'[Region]),"Europe"),0,1)

2.png

Please let me know if I misunderstood.

 

Best Regards,
Community Support Team _ Eason

koorosh
Post Partisan
Post Partisan

CALCULATETABLE('Sheet1',KEEPFILTERS('Sheet1'[Location] in {"India"} = False))


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos!
johnt75
Super User
Super User

Change the visual filter on the table to exclude India

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.