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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
debenaire
Helper I
Helper I

Visual Showing Duplicate Records when I only want the max!

Hi, I am trying to show the latest date for a given ID and show corresponding information for that record in a table visual. The dax works well but only when i show the ID. when i bring in other fields from the same table it duplictes the id as there may be different names. all i want to show is the record for the mx date. Can anyone help please i'ts driving me mad! Thanks.

 

My dax is:

 

Latest Status =
var Max_Date = MAX('Date Selection - Contacts'[Date])
 return
CALCULATE(max('contacts'[CreatedOn]),

values(contacts'[DBName-Contact_Id]),

    'contacts'[CreatedOn] <= Max_Date)
 
See attached screenshots of what shows with the DBName-Contact_Id alone versus brining in an additional field from the contact table. Thanks in advance!!
 
two records because the name is differenttwo records because the name is differentDBName only.png
4 REPLIES 4
debenaire
Helper I
Helper I

thanks but values still show

ray_codex
Resolver II
Resolver II

The filter context of your first visual has 2 names, so does a calculation on both names returning your last status calculation's result on both names. I think you can remove this with adding ALL(yourtable[name]) as a parameter to CALCULATE.

thank you so do you mean removing the values part of the fliter? are you able to rewrite? i thought i may need this as i want to make sure there is only a value per dbname-id? thanks

Latest Status =
var Max_Date = MAX('Date Selection - Contacts'[Date])
 return
CALCULATE(max('contacts'[CreatedOn]),

 

values(contacts'[DBName-Contact_Id]),

 

    'contacts'[CreatedOn] <= Max_Date, ALL('contacts'[Name])
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.