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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
NewbieJono
Post Patron
Post Patron

Return Value based on max date

Hello, i am trying to return the volume (marked in yellow) 0.906. it does not seem to be working, I think its something to do with the max date criteria.

 

i would like to return the latest (max date) for Measure 1, Baseline

 

Capture.PNG

 

I have tried 

 

Test = 
CALCULATE (
    SUM ( 'DIM - Targets'[Volume] ),
    'DIM - Targets'[Measure] = "Measure1",
    'DIM - Targets'[Type] = "Baseline",
    LASTDATE ( 'DIM - Targets'[Date] )
)

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NewbieJono , try measure like

 

Last Status = var _max = maxx(filter(ALLSELECTED('DIM - Targets'), 'DIM - Targets'[Measure] = "Measure1" && 'DIM - Targets'[Type] = "Baseline"), 'DIM - Targets'[Date] )
return
CALCULATE(sum( 'DIM - Targets'[Volume] ), filter(('DIM - Targets') , 'DIM - Targets'[Date] =_max))

 

 

Latest Date Date | Latest Data
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@NewbieJono , try measure like

 

Last Status = var _max = maxx(filter(ALLSELECTED('DIM - Targets'), 'DIM - Targets'[Measure] = "Measure1" && 'DIM - Targets'[Type] = "Baseline"), 'DIM - Targets'[Date] )
return
CALCULATE(sum( 'DIM - Targets'[Volume] ), filter(('DIM - Targets') , 'DIM - Targets'[Date] =_max))

 

 

Latest Date Date | Latest Data
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors