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!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Top Solution Authors