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
Anonymous
Not applicable

Variable with last date selection

Hi,

As you can see below i have for tyhis Invoice-nr different ststus registration in colomn WBRKC101. I want to have the last status which is FS with date 09/22/2021. How can i  doe it? Please help me.

wsharifzada_1-1644333823351.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Yours is a column, not a measure. If you want a column, please try:

Column = 
var _lastDate=CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[Invoic-nr.]))
return IF([Date]=_lastDate,[Status],BLANK()) 

Eyelyn9_0-1644565187926.png

 

Best Regards,
Eyelyn Qin
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

8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous ,

 

Yours is a column, not a measure. If you want a column, please try:

Column = 
var _lastDate=CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[Invoic-nr.]))
return IF([Date]=_lastDate,[Status],BLANK()) 

Eyelyn9_0-1644565187926.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

It works! Thank you !

Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

Measure = 
var _lastDate=MAXX(FILTER(ALL('Table'),[Invoic-nr.]=MAX('Table'[Invoic-nr.])),[Date])
return CALCULATE(MAX('Table'[Status]),FILTER('Table',[Date]=_lastDate))

Eyelyn9_0-1644551988225.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Eyelyn,
Thannk you for your effort.
I have used your solution, but it does not work unfortunetly. 

wsharifzada_0-1644561445513.png

Kind regards.
Walid

 

Whitewater100
Solution Sage
Solution Sage

Hi:

 

You can use MAX(TableName[Date]) and filter in a visualization.

 

If you want to be specific about FS:

Calculate(MAX(TableName[DATE]),
FILTER(TableName,
TableName[Status] = "FS")
)
 
I hope this helps!
Anonymous
Not applicable

Hi Whitewater100,

Thank you for your quick answer! Wat i actualy want is this: Fill column Actual Status as a nieuw measure

wsharifzada_0-1644387233657.png

 

THanx!

 

amitchandak
Super User
Super User

@Anonymous , Try a measure like

 


Measure =
VAR __id = MAX ('Table'[Invoice-nr] )
VAR __date = CALCULATE ( MAX('Table'[date] ), ALLSELECTED ('Table' ), 'Table'[Invoice-nr] = __id )
CALCULATE ( MAX ('Table'[Status] ), VALUES ('Table'[Invoice-nr] ),'Table'[Invoice-nr] = __id,'Table'[date] = __date )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amitchandak,

Thank you for your quick answer!
Wat i actualy want is this: Fill column "Actual Status" as a nieuw measure with status with newst/latest date.

 

wsharifzada_0-1644387294819.png

Thank You!

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.