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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.