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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
sirgseymour
Helper I
Helper I

Displaying the latest date for a subset of records in a table

Hello,

 

I have a table that contains a list of Portfolios that are updated independantly periodically independantly and I want to display the latest date that each one of these portfolios were updates. In the table below, I want to calculate the LatestRollupdate for each Portfolio and then add an indicator for Latest/Not? I have used the following measures and column formulas but am unable to filter the measure by Portfolio. Any ideas?

 

Measure:

Last Date = CALCULATE(Table1[Rollup Date],ALL(Table1)) - Returns the laset date for whole table not filtered by Portfolio

 

Column:

 

Latest Portfolio = if(Table1[Rollup Date]=Table1[Last Date],"Latest","Not")

 

 

PortfolioRollup DateLatest Rollup DateLatest/Not?
101-09-1810-09-18Not
102-09-1810-09-18Not
104-09-1810-09-18Not
110-09-1810-09-18Latest
203-09-1805-09-18Not
205-09-1805-09-18Latest
305-10-1812-11-18Not
311-11-1812-11-18Not
312-11-1812-11-18Latest
401-10-1822-10-18Not
402-10-1822-10-18Not
403-10-1822-10-18Not
422-10-1822-10-18Latest
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @sirgseymour,

 

You can use below formula to achieve your requirement:

Measure formula:

Last Date = 
CALCULATE (
    MAX ( 'Sample'[Rollup Date] ),
    ALLSELECTED ( 'Sample' ),
    VALUES ( 'Sample'[Portfolio] )
)

Calculate column formula:

Is Last = 
VAR _lastdate =
    CALCULATE (
        MAX ( 'Sample'[Rollup Date] ),
        FILTER ( ALL ( 'Sample' ), [Portfolio] = EARLIER ( 'Sample'[Portfolio] ) )
    )
RETURN
    IF ( [Rollup Date] = _lastdate, "LastDate", "Not" )

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Write these 2 calculated column formulas

 

Latest Rollup Date=CALCULATE(MAX(Table1[Rollup Date]),FILTER(Table1,Table1[Portfolio]=EARLIER(Table1[Portfolio])))

Latest/Not?=IF([Latest Rollup Date]=[Rollup Date],"Latest","Not")

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-shex-msft
Community Support
Community Support

Hi @sirgseymour,

 

You can use below formula to achieve your requirement:

Measure formula:

Last Date = 
CALCULATE (
    MAX ( 'Sample'[Rollup Date] ),
    ALLSELECTED ( 'Sample' ),
    VALUES ( 'Sample'[Portfolio] )
)

Calculate column formula:

Is Last = 
VAR _lastdate =
    CALCULATE (
        MAX ( 'Sample'[Rollup Date] ),
        FILTER ( ALL ( 'Sample' ), [Portfolio] = EARLIER ( 'Sample'[Portfolio] ) )
    )
RETURN
    IF ( [Rollup Date] = _lastdate, "LastDate", "Not" )

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you that worked!!1

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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