cancel
Showing results for
Did you mean:
Highlighted
pushkard5 Regular Visitor

## 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.
1 ACCEPTED SOLUTION

Accepted Solutions Super User

## Re: Getting Difference in Result values in Calculated Column and Measure

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 2 Super User

## Re: Getting Difference in Result values in Calculated Column and Measure

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

pushkard5 Regular Visitor

## Re: Getting Difference in Result values in Calculated Column and Measure

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