Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Getting Difference in Result values in Calculated Column and Measure

Hello Experts,

 

I am caulculating averge per category on a dataset. I am getting diffrence between the result values of calculated column and calculated measure.

Is this possible?

The formulas I am using are -

 

1. Calculated Column- 

CALCULATE(AVERAGE('All Data'[Test Result]),FILTER('All Data','All Data'[Key1]=EARLIER('All Data'[Key1])))
 
2. Calculated Measure-
CALCULATE(AVERAGE('All Data'[Test Result]),FILTER('All Data','All Data'[Key1]=MAX('All Data'[Key1])))
 
Why I am getting diffrence in result values as the dataset is same.
Please help..
  • Anonymous 

     

     

    What if you use this MEASURE...would there still be a difference?

     

    CALCULATE(AVERAGE('All Data'[Test Result]),FILTER(all('All Data'),'All Data'[Key1]=MAX('All Data'[Key1])))

     

    In a MEASURE, the table passed on to the FILTER function's first argument would be affected by filtered context

    but not so in Calculated column

2 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Anonymous 

     

     

    What if you use this MEASURE...would there still be a difference?

     

    CALCULATE(AVERAGE('All Data'[Test Result]),FILTER(all('All Data'),'All Data'[Key1]=MAX('All Data'[Key1])))

     

    In a MEASURE, the table passed on to the FILTER function's first argument would be affected by filtered context

    but not so in Calculated column

    • Anonymous's avatar
      Anonymous
      Not applicable

      Zubair_Muhammad 

       

      Hi, Thanks for your help..this works Perfectly!!