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
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors