Getting a trend value for a subset of the calculation for a chart

I have a linear regression trend line. Pop it on the chart and it works great. However if I want a card for a subset of that trend it behaves differently as that subset will produce different values. (Its the context of the number of months - this shapes the trend)

I think I need to create the trend and predicted sales as per my chart but then sum a subset .

In Dax Studio I got as far as the code below. If I could get the total value of Banana from __DSCCore this would give me the answer.

Hope that makes sense. Any suggestuions gratefully received.
E

DEFINE

VAR __YearOffset = TREATAS({-1, 0, BLANK()}, ‘dim Year’[Year offset])

VAR __DS0Core =
SUMMARIZECOLUMNS(
‘dim Fiscal Year’[FiscalYearPeriod],
‘dim Fiscal Year’[Fiscal Month offset],
__YearOffset,
“Banana”, IF ( MAX(‘dim Year’[Month offset]) >-1 ,‘MM’[Trend Regression] ,0),
“Trend Sales”, ‘MMs’[Trend Sales],
“Trend Regression”, ‘MM’[Trend Regression]//,
)

EVALUATE __DS0Core
ORDER BY
      'dim Fiscal Year'[Fiscal Month offset], 
      'dim Fiscal Year'[FiscalYearPeriod]

Hi @ells, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

image

  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

@EnterpriseDNA
Still stuck on this and its not getting any clearer
E