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
derickson091
Frequent Visitor

Create measure to identify most recent data (without date functions)

Goal: create a measure to identify the most recent data for a specific product ID in a specific month.

Issue: there is no date information, but rather a VersionID. The highest VersionID will indicate the most recent data.

Example: for the Car product with ProductID "1010," I want to be able to return the most recent data for the month of January (i.e. 675).

VersionID Data example.PNG

 

Thank you in advance!

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @derickson091 

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

Try this:

1. Place GRoup and ID in the rows of a table visual

2. Place this measure in the visual

Measure =
VAR LastVer_ =
    MAX ( Table1[VersionID] )
RETURN
    CALCULATE ( MAX ( Table1[Units] ), Table1[VersionID] = LastVer_ )

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @derickson091 

Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

Try this:

1. Place GRoup and ID in the rows of a table visual

2. Place this measure in the visual

Measure =
VAR LastVer_ =
    MAX ( Table1[VersionID] )
RETURN
    CALCULATE ( MAX ( Table1[Units] ), Table1[VersionID] = LastVer_ )

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

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.