Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
Below is a sample data set:
| PO# | Invoice# | Date | Quantity |
| 123 | q123 | 01-02-2020 | 20 |
| 456 | q456 | 02-02-2020 | 30 |
| 789 | q789 | 03-04-2020 | 2 |
| 789 | a789 | 05-04-2020 | 3 |
| 789 | z789 | 06-04-2020 | 5 |
I want to display the latest data for each PO#, hence the result should be:
| PO# | Invoice# | Date | Quantity |
| 123 | q123 | 01-02-2020 | 20 |
| 456 | q456 | 02-02-2020 | 30 |
| 789 | z789 | 06-04-2020 | 5 |
Any suggestion on how I can achieve this via DAX?
Solved! Go to Solution.
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
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 )
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 59 | |
| 51 | |
| 46 |