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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
daliux
Frequent Visitor

Value for maxdate

Hello.

I have items with dates of status change. I need a column for last status of selected period. I need dax formula for a values of staus on max logged_at date  for each item (id). Result sould be like this: in 1 case it should be 'pau', in 2 case - 'pau' too. Could someone help me, please?

 

daliux_0-1648725605905.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @daliux 

I created a sample with the data you provided .

Create a measure to return the Status with latest date .

 

Measure =
VAR _maxdate=CALCULATE(MAX('Table'[logged_at]),ALLEXCEPT('Table','Table'[Id]))
var _status=CALCULATE(MAX('Table'[Status]),FILTER('Table','Table'[Id]=MAX('Table'[Id]) && 'Table'[logged_at]=_maxdate))
return _status

 

Then put the measure in your table visual , you will get a result like below .

Ailsamsft_0-1649051897875.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
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
Anonymous
Not applicable

Hi @daliux 

I created a sample with the data you provided .

Create a measure to return the Status with latest date .

 

Measure =
VAR _maxdate=CALCULATE(MAX('Table'[logged_at]),ALLEXCEPT('Table','Table'[Id]))
var _status=CALCULATE(MAX('Table'[Status]),FILTER('Table','Table'[Id]=MAX('Table'[Id]) && 'Table'[logged_at]=_maxdate))
return _status

 

Then put the measure in your table visual , you will get a result like below .

Ailsamsft_0-1649051897875.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@daliux , You can create status measure like

Measure =
VAR __id = MAX ('Table'[id] )
VAR __Version_Id = CALCULATE ( MAX('Table'[Logged_at] ), ALLSELECTED ('Table' ), 'Table'[id] = __id )
RETURN CALCULATE ( MAX ('Table'[Status] ), VALUES ('Table'[id] ),'Table'[id] = __id,'Table'[Logged_at] = __Version_Id )

 

and use that in visual

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.