Forum Discussion

ChrisB1977's avatar
ChrisB1977
Frequent Visitor
7 years ago
Solved

Using measures in rolling 6 month averages

Hi,

 

I'm having trouble working out a rolling average

 

I have a measure I've created:

Sentiment PosNeu = table1[Positive+Neutral Sentiment] /table1[Positive+Neutral+Negative Sentiment]

 

This is a percentage calculated from sums of integers across 3 different values (so, Positive + Neutral Sentiment is calculated using sums of the 2 values)

 

I've then calculated a rolling 6 month average based on this:

Sentiment PosNeu R 6M Ave = CALCULATE(AVERAGE(table1[Sentiment PosNeu]),DATESBETWEEN(table1[startDate],DATEADD(LASTDATE(table1[startDate]),-6,MONTH),LASTDATE(table1[startDate])))

 

However, it's telling me that table1(sentiment PosNeu) either can't be found or can't be used in the expression - any ideas why this is the case? 

 

Many thanks in advance!


Chris

 
  • Hi ChrisB1977,

     

    Please use this formula to create a calculated column instead of measure. If it doesnt' work, kindly share your sample data or pbix to me.

     

    Sentiment PosNeu = table1[Positive+Neutral Sentiment] /table1[Positive+Neutral+Negative Sentiment]

     

    Regards,

    Frank

2 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi ChrisB1977,

     

    Please use this formula to create a calculated column instead of measure. If it doesnt' work, kindly share your sample data or pbix to me.

     

    Sentiment PosNeu = table1[Positive+Neutral Sentiment] /table1[Positive+Neutral+Negative Sentiment]

     

    Regards,

    Frank

    • v-frfei-msft's avatar
      v-frfei-msft
      Icon for Community Support rankCommunity Support

      Hi ChrisB1977,

       

      Does that make sense? If so, kindly mark my answer as a solution to close the case.

       

      Regards,
      Frank