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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
giordafrancis
Frequent Visitor

DAX Group by on column but only display latest date budget

Consider the below table

 

iddatebudget
10101/06/2020    50
10101/07/2020    100
10301/06/2020    50
10301/07/2020    50
10301/08/2020    20

 

I'm looking to create a measures

  1. that groups by on the id col
  2. but only presents the latest entry based on date

Desired output is a table as below

 last datebudget
10101/07/2020    100
10301/08/2020    20

 

 

Thank you in advance

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @giordafrancis ,

 

 

You can use this for Last Date

 

Last Date = CALCULATE(LASTNONBLANK('Table'[date],1) ,FILTER(ALL('Table'[id]), 'Table'[id] = MAX('Table'[id])))

 

and the above mentioned measure for Last Budget.

Last Budget = 
lastnonblankvalue('Table'[date],sum('Table'[budget]))

 

 Regards,

Harsh Nathani

View solution in original post

2 REPLIES 2
harshnathani
Community Champion
Community Champion

Hi @giordafrancis ,

 

 

You can use this for Last Date

 

Last Date = CALCULATE(LASTNONBLANK('Table'[date],1) ,FILTER(ALL('Table'[id]), 'Table'[id] = MAX('Table'[id])))

 

and the above mentioned measure for Last Budget.

Last Budget = 
lastnonblankvalue('Table'[date],sum('Table'[budget]))

 

 Regards,

Harsh Nathani

amitchandak
Super User
Super User

@giordafrancis , use this for budget

lastnonblankvalue(Table[date],max(Table[budget]))

or

lastnonblankvalue(Table[date],sum(Table[budget]))

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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