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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lilych
Helper II
Helper II

Latest date based on multiple columns

Hello -

 

I have a table (see below) where updates are being entered. I only want to show the latest Created On Date based on the Department and Product columns. So for Marketing + Category A's update, I only want the 2nd bolded update to show, since it is the latest update for that department and product.

 

How would I go about doing this? Thanks in advance!

 

Department Product LineUpdateCreated On
MarketingCategory AVersion 1 update6/16/21 8:01 AM 
MarketingCategory AVersion 2 update6/16/21 10:21 AM
Marketing Category BVersion 1 update6/16/21 2:00 PM
SalesCategory AUpdate6/16/21 9:36 AM
1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @lilych ,

 

I did a test, the reference is as follows:

M_update =
VAR _max =
    CALCULATE (
        MAX ( 'Table'[Created On] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Product Line] = MAX ( 'Table'[Product Line] )
                && 'Table'[Department ] = MAX ( 'Table'[Department ] )
        )
    )
RETURN
    CALCULATE ( MAX ( 'Table'[Update] ), 'Table'[Created On] = _max )

vhenrykmstf_0-1624257712790.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @lilych ,

 

I did a test, the reference is as follows:

M_update =
VAR _max =
    CALCULATE (
        MAX ( 'Table'[Created On] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Product Line] = MAX ( 'Table'[Product Line] )
                && 'Table'[Department ] = MAX ( 'Table'[Department ] )
        )
    )
RETURN
    CALCULATE ( MAX ( 'Table'[Update] ), 'Table'[Created On] = _max )

vhenrykmstf_0-1624257712790.png

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

notem
Frequent Visitor

@lilych ,

notem_0-1623886483935.png

Measure = 
VAR a = MAX(Sheet1[Created On]) 
RETURN 
    CALCULATE(MAX(Sheet1[Line Update]), Sheet1[Created On] = a)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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