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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ivancans
Frequent Visitor

MAX date for an ID with repeating dates

Hello,

 

I would like to get your help in the following matter. I have ID's with multiple dates. I need to return latest date for each of the ID's and compare the result with the specific row. If the result matches, I will use it as a filter, to make my inital table unique which will allow me to use it as a lookup table when I will create relationships later. Example of the problem:

 

dates.PNG

 

The problem is that I am completely new to so called M language and can't really figure out how to solve this with M formulas/sytanx.

1 ACCEPTED SOLUTION

@ivancans

 

Sorry I was out of office

 

In Query Editor, you can use Group By Function to get the Max Dates for each ID

 

Groupby.png


Regards
Zubair

Please try my custom visuals

View solution in original post

7 REPLIES 7
Zubair_Muhammad
Community Champion
Community Champion

@ivancans

 

You could also use DAX calculated column

 

Max Date =
CALCULATE (
    MAX ( Table1[Date Hour and Minutes] ),
    ALLEXCEPT ( Table1, Table1[Application ID] )
)

Regards
Zubair

Please try my custom visuals

Thanks @Zubair_Muhammad but I thought that it is better to do it in query mode because it is somehow less hardware demanding procedure. Am I wrong on this one?

Also, how can I filter out ture ones in data view so that the table becomes uniqe in relationship view. I did filter out the value but I still couldn't create relationship. See screens attached.  date true.PNGrelationship error.PNG

@ivancans

 

Sorry I was out of office

 

In Query Editor, you can use Group By Function to get the Max Dates for each ID

 

Groupby.png


Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad 

What if my dataset has more than 1 column apart from the ID (Group By), and I want to return the whole row? Is it possible?

Thank you!

 

Anonymous
Not applicable

Brilliant solution for this scenario!

Thanks,

Jeroen

Thank you @Zubair_Muhammad ! I actually stumbled upon this solution half an hour ago, but nontheless this seems to be the right solution! Smiley Happy

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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