cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OlegV
Helper I
Helper I

Show last data label only on a line chart

Hello,

I have a table and in the column "LatestPrice" I need to show a price only for the last day of the given period. Now all the prices are shown.

What I have done:

1) Created a measure using Lastdate function to determine the last date of the given period.

LastDate = LASTDATE('Brent&₽/$'[Date])
OlegV_4-1629737575905.png

 

2) Created a measure to determine the latest price (the price of the last day)

LatestPrice = CALCULATE(AVERAGE('Brent&₽/$'[Brent price]),FILTER('Brent&₽/$','Brent&₽/$'[Date]=[LastDate]))
OlegV_3-1629737529057.png

 

Somehow it shows all the prices but not the price only for the last day of the period.
 
Please tell me where the mistake is. Thank you!
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@OlegV LastDate = MAXX(ALL('Brent&₽/$'),[Date])


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

2 REPLIES 2
OlegV
Helper I
Helper I

@ Greg_Deckler

 
 

Thank you very much. It solved a problem.

Greg_Deckler
Super User
Super User

@OlegV LastDate = MAXX(ALL('Brent&₽/$'),[Date])


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.