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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MrNoob
Helper II
Helper II

Last Value used as line to beat

So I have a line chart and bar chart combo,  The bars are the industry average, then the blue line is my companies performance and the dotted line is a metric we want to beat.  Now the dotted line is a 7 day moving average.  I am wishing to take the last value from 3/6/18 and use that value for the rest of the dates.  To make a straight line all the way across.  What would i insert into my measure to make this so, below is my current measure

 

 

SS = DIVIDE(CALCULATE(SUM(OAG[Total Seats]),OAG[oper_carr]="__"),(CALCULATE(SUM(OAG[Total Seats]),ALL(OAG[oper_carr]))))


SS MA = CALCULATE([SS], DATESINPERIOD('Date'[Date], LASTDATE('Date'[Date]),-7, DAY ) )

 

 

graph.JPG

1 ACCEPTED SOLUTION

Hi,

 

Try this measure

 

=CALCULATE([ss],DATESBETWEEN('Date'[Date],MAXX(ALL('Date'[Date]),'Date'[Date]),MAXX(ALL('Date'[Date]),'Date'[Date])))

 

If this does not work, share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

I am unclear.  Do you want to insert a 4th line (which will be parallel to the X axis) with a value which equates to the value on the last date?

 

Please clarify.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I want to make the black dashed line run parallel to the x axis. whit the value equating to the last value, which in this case is 3/6/2018 value.

Hi,

 

Try this measure

 

=CALCULATE([ss],DATESBETWEEN('Date'[Date],MAXX(ALL('Date'[Date]),'Date'[Date]),MAXX(ALL('Date'[Date]),'Date'[Date])))

 

If this does not work, share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.