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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
databot_kd
Helper II
Helper II

DAX to remove rows that are similar but comparing different columns/rows

Hi Community, 

 

hoping you can assist please.

I am trying to remove rows from my table using DAX based on what are considered as duplicate. 

For example from the screenshot below APL to GLG and GLG to APL is the same transfer i need it to only show one row. 

databot_kd_0-1704857238949.png

 

Any help would be appreciated

Group ToGroup FromTransfer Amount
APLGLG1000
GLGAPL1000
GLGPCH450
PCHGLG450
PLSKLM360
KLMPLS360
2 ACCEPTED SOLUTIONS
databot_kd
Helper II
Helper II

Hi community, 

 

hoping you can assist. I am trying to create a variance to show the balance between inter related entities. 

Please see below of my current data and my required output
I have provided any updated screenshot as this hopefully will clarify the current data output and issue. 


databot_kd_0-1705307045991.png



Thanks
@Ahmed 
@Jihwan_Kim 

View solution in original post

Anonymous
Not applicable

Hi @databot_kd ,

If I understand correctly, the issue is that you want to remove rows. Please try the following methods and check if they can solve your problem:

1.Create the simple table. 

vjiewumsft_0-1705453894020.png

 

2.Create a calculated column that generate a unique identifier for each transfer.

 

Column = 
VAR GroupFrom = [FromBiz]
VAR GroupTo = [ToBiz]
VAR MinGroup = MIN(GroupFrom, GroupTo)
VAR MaxGroup = MAX(GroupFrom, GroupTo)
RETURN
CONCATENATE(MinGroup, MaxGroup)

3.Create a new table Table 2 that removes duplicates based on the column.

Table 2 = 
SUMMARIZE(
    'Table',
    'Table'[Column],
    "FromBiz", MINX(FILTER('Table', 'Table'[Column] = EARLIER('Table'[Column])), [FromBiz]),
    "ToBiz", MAXX(FILTER('Table', 'Table'[Column] = EARLIER('Table'[Column])), [ToBiz]),
    "Amount", SUMX(FILTER('Table', 'Table'[Column] = EARLIER('Table'[Column])), [Amount])
)

4.The result is shown below.

vjiewumsft_1-1705453972786.png

 

Looking forward to your reply.

Best Regards,

Wisdom Wu

 

View solution in original post

7 REPLIES 7
databot_kd
Helper II
Helper II

Hi community, 

 

hoping you can assist. I am trying to create a variance to show the balance between inter related entities. 

Please see below of my current data and my required output
I have provided any updated screenshot as this hopefully will clarify the current data output and issue. 


databot_kd_0-1705307045991.png



Thanks
@Ahmed 
@Jihwan_Kim 

Anonymous
Not applicable

Hi @databot_kd ,

If I understand correctly, the issue is that you want to remove rows. Please try the following methods and check if they can solve your problem:

1.Create the simple table. 

vjiewumsft_0-1705453894020.png

 

2.Create a calculated column that generate a unique identifier for each transfer.

 

Column = 
VAR GroupFrom = [FromBiz]
VAR GroupTo = [ToBiz]
VAR MinGroup = MIN(GroupFrom, GroupTo)
VAR MaxGroup = MAX(GroupFrom, GroupTo)
RETURN
CONCATENATE(MinGroup, MaxGroup)

3.Create a new table Table 2 that removes duplicates based on the column.

Table 2 = 
SUMMARIZE(
    'Table',
    'Table'[Column],
    "FromBiz", MINX(FILTER('Table', 'Table'[Column] = EARLIER('Table'[Column])), [FromBiz]),
    "ToBiz", MAXX(FILTER('Table', 'Table'[Column] = EARLIER('Table'[Column])), [ToBiz]),
    "Amount", SUMX(FILTER('Table', 'Table'[Column] = EARLIER('Table'[Column])), [Amount])
)

4.The result is shown below.

vjiewumsft_1-1705453972786.png

 

Looking forward to your reply.

Best Regards,

Wisdom Wu

 

Thanks @Anonymous 

Your solution really helped me. Much appreciated,

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file whether it suits your requirement.

 

Jihwan_Kim_0-1704860611257.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim , thanks for asssiting. 

Tried this had a issues when using EARLIER for the amount as the amount is a measure coming from another table. Apologies i should have mentioned that. 

amitchandak
Super User
Super User

@databot_kd , Create a measure like this use with Group To , Group From in visual

 

measure =Sumx(summarize(Table, Table[Group To],Table[Group From], Table[Transfer Amount]),Table[Transfer Amount])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

Thanks for assisting. I tried the measure you provided but i get the same result as before.
Not sure if this is cause the amount is coming from a different table. Would you have any other thoughts on where i am going wrong?

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors