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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Remove deplicate rows based on lowest number

I am struggling to get this working.

This is a small portion of my dataset. My dataset only contains TicketId, CommentId (not shown here, not really important), and CommentDuration. CommentDuration is a calculated column.

werner1107_0-1597313313785.png

 

What I am trying to achieve is to remove rows with the same TicketId, keeping only the lowest CommentDuration. How can I do this? Preferably as a DAX measure...

Thanks in advance

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Kindly check below results:

Measure = var a = CALCULATE(MIN('Table (2)'[CommentDuration]),ALLEXCEPT('Table (2)','Table (2)'[Ticketid]))
return 
IF(MAX('Table (2)'[CommentDuration])=a,a,BLANK())

07.PNG 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Kindly check below results:

Measure = var a = CALCULATE(MIN('Table (2)'[CommentDuration]),ALLEXCEPT('Table (2)','Table (2)'[Ticketid]))
return 
IF(MAX('Table (2)'[CommentDuration])=a,a,BLANK())

07.PNG 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@Anonymous , Try a measure like these

sumx(summarize(table, table[TicketId],"_1",min(CommentDuration )),[_1])

or

sumx(values(table[TicketId]),min(CommentDuration ))

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
Fowmy
Super User
Super User

@Anonymous 

Create a new table with the following code (Go to Modeling ab, 'under Calculation, New Table

New Table = 

SUMMARIZECOLUMNS(
    TICKET[TicketID],
    "MinDur",
    MIN(TICKET[CommetnDuration])
)

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.