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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
GAETAN63
New Member

Get the most recent value from a numeric column

Hello, I have a table with lower and upper limits given for specific products (mix name) and measurements method (propertie). Those limits can change with time, and I'm looking for a DAX measurement to give the last limits, I mean the one from the most recent date indication. I tried LASTNONBLANK function on my lower (TI) and upper (TS) columns but it sorts those numeric column from mini to maxi and give me... the maxi! Any solution to identify the most recent limits from my table?

 

Thanks,Summury table given by LASTNONBLANK DAX functions and data source tableSummury table given by LASTNONBLANK DAX functions and data source table

1 ACCEPTED SOLUTION
GAETAN63
New Member

Hi all! I found a great solution on this last post: https://community.powerbi.com/t5/Desktop/How-can-I-get-the-last-value-of-a-column-in-my-dataset/td-p... 

 

I put the solution in an updated picture, thanks to all answers below!

 

see you,

 

DATA_BIS.PNG

View solution in original post

4 REPLIES 4
GAETAN63
New Member

Hi all! I found a great solution on this last post: https://community.powerbi.com/t5/Desktop/How-can-I-get-the-last-value-of-a-column-in-my-dataset/td-p... 

 

I put the solution in an updated picture, thanks to all answers below!

 

see you,

 

DATA_BIS.PNG

Anonymous
Not applicable

[Last TI] =
if( 
	HASONEVALUE( T[Mix Name] )
	&& HASONEVALUE( T[Propertie] ),

	var __rows =
		topn(1,
			YourTable,
			YourTable[Date Fabrication],
			DESC
		)
	return
		if(
			COUNTROWS( __rows ) = 1,
			MAXX(
				__rows,
				YourTable[TI]
			)
		)
)

[Last TS] =
if( 
	HASONEVALUE( T[Mix Name] )
	&& HASONEVALUE( T[Propertie] ),

	var __rows =
		topn(1,
			YourTable,
			YourTable[Date Fabrication],
			DESC
		)
	return
		if(
			COUNTROWS( __rows ) = 1,
			MAXX(
				__rows,
				YourTable[TS]
			)
		)
)

 

Best

D

camargos88
Community Champion
Community Champion

Hi @GAETAN63 ,

 

Create this new column: 

LastItem = IF('Table'[Date] = CALCULATE(MAX('Table'[Date]); filter('Table'; 'Table'[Name] = EARLIER('Table'[Name]))); 1; 0)
Capture.PNG
Filter the visual:
Capture1.PNG
 
 


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



harshnathani
Community Champion
Community Champion

Hi @GAETAN63 ,

 

I am not very clear as to what is your expected outcome. However, you can create a Table.

 

New Table = Filter ('Table', 'Table'[DateFabrication] = Min('Table'[Data Fabrication])

 

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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