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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Vysakh
Regular Visitor

Display latest data based on other fields

Hi all,

 

Below is a sample data set:

 

PO#Invoice#DateQuantity
123q12301-02-202020
456q45602-02-202030
789q78903-04-20202
789a78905-04-20203
789z78906-04-20205

 

I want to display the latest data for each PO#, hence the result should be:

 

PO#Invoice#DateQuantity
123q12301-02-202020
456q45602-02-202030
789z78906-04-20205

 

Any suggestion on how I can achieve this via DAX?

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Vysakh 

 

You can create a measure like below 

Measure = 
VAR __maxDate = 
    CALCULATE(
        MAX( 'Table'[Date] ),
        ALL( 'Table' ),
        VALUES( 'Table'[PO#] )
    )
RETURN 
CALCULATE(
    INT( NOT ISEMPTY( 'Table' ) ),
    'Table'[Date] = __maxDate 
)

 

And use it as a visual filter like below

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Measure =
VAR __id = MAX ( 'Table'[PO #] )
VAR __date = CALCULATE ( MAX( 'Table'[Date] ), ALLSELECTED ( 'Table' ), 'Table'[PO #] = __id )
RETURN CALCULATE ( sum ( 'Table'[Quantity] ), VALUES ( 'Table'[PO # ), 'Table'[PO #] = __id, 'Table'[Date] = __date )

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
Mariusz
Community Champion
Community Champion

Hi @Vysakh 

 

You can create a measure like below 

Measure = 
VAR __maxDate = 
    CALCULATE(
        MAX( 'Table'[Date] ),
        ALL( 'Table' ),
        VALUES( 'Table'[PO#] )
    )
RETURN 
CALCULATE(
    INT( NOT ISEMPTY( 'Table' ) ),
    'Table'[Date] = __maxDate 
)

 

And use it as a visual filter like below

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors