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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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