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
Anonymous
Not applicable

Turning a Measure into a Column when calculating max dates

Hi all, 

 

I have a measure that works to calcualte the maximum date from a range of dates (amended, document uploaded, contacts modified) which I am using to identify the last time a record has been interacted with. By using measures I have been able to compare these using MAX and return a single value against each ID which is great, but Measures do not appear to work as slicers or when trying to report back on values on a Card visual. 

 

As an example, I have:

IDamendeddocument uploadedcontacts modified
110/10/202301/02/202308/08/2021
205/06/202310/10/202308/09/2022
501/08/202009/12/202105/10/2023
1 01/01/2024 
502/02/2024  

 

So, for each ID the latest date would be:

1 - 01/01/2024

2 - 10/10/2023

5 - 02/02/2024

 

How would I approach this as a calculated column? 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous Measure is one that will respond to slicer value

 

measure should be like - Maxx({Max(Table[amended]),Max(Table[document uploaded] ), Max(Table[contacts modified])}, [Value])

 

 

Column will be like

 

calculate(Maxx({(Table[amended]),(Table[document uploaded] ), (Table[contacts modified])}, [Value]), filter(Table, Table[ID] = Earlier(Table[ID])))

 

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous Measure is one that will respond to slicer value

 

measure should be like - Maxx({Max(Table[amended]),Max(Table[document uploaded] ), Max(Table[contacts modified])}, [Value])

 

 

Column will be like

 

calculate(Maxx({(Table[amended]),(Table[document uploaded] ), (Table[contacts modified])}, [Value]), filter(Table, Table[ID] = Earlier(Table[ID])))

 

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
Anonymous
Not applicable

Thanks, for my Measures (as document uploaded is a separate table), I had used the MAX function to the the MAX of each and then compared those to get the final number at the end

 

Max_date Amended= CALCULATE(MAX(table[amended]), ALLEXCEPT(table, table[ID]))
Max_date Modified = CALCULATE(MAX(table[modified]), ALLEXCEPT(table, table[ID]))
 
And then
 
Max_date = MAX('Table'[Max_date Amended], 'Table'[Max_date Modified])
 
etc
 
This way I get a single date value for each ID via the measure, which is what I need - something that looks across all the dates associated with the ID and returns a single latest date. My issue with the Measure is that it can produce a table of data, but it's not as useful when trying to use for Totals on Card visuals for example.
 
I have just realised that I could use the 'Latest' filter on the data to reduce this to the most recent date against each ID, so it may well be that you've already solved my query - I will explore further. 
 
Thanks! 

 

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.