Forum Discussion
Anonymous
7 years agoNot applicable
EARLIER function not working
I have the following problem: There is a table column with quarterly metreage called Total. However, it is reported not quarterly but as YTD (Q2 will report Q1+Q2, Q3 will report everything since...
- 7 years ago
Hi Anonymous
You may refer to below measure. Please let me know if it matches your request or not.
Year = RIGHT(Drilling[Quarter],4)
total2 = CALCULATE ( SUM ( Drilling[Development] ), FILTER ( Drilling, Drilling[Year] = EARLIER ( Drilling[Year] ) && Drilling[Quarter] <= EARLIER ( Drilling[Quarter] ) ) )Regards,
Cherie
v-cherch-msft
7 years agoMicrosoft Employee
Hi Anonymous
You may refer to below measure. Please let me know if it matches your request or not.
Year = RIGHT(Drilling[Quarter],4)
total2 =
CALCULATE (
SUM ( Drilling[Development] ),
FILTER (
Drilling,
Drilling[Year] = EARLIER ( Drilling[Year] )
&& Drilling[Quarter] <= EARLIER ( Drilling[Quarter] )
)
)
Regards,
Cherie
Anonymous
7 years agoNot applicable
Hi, v-cherch-msft!
I do not not why, but your formula with EARLIER works perfectly fine. Probably, in my formula it had problems with IF or something else.
However, your formula was not what I asked for. I needed to calculate the difference between two quarters, but not the sum of all preceding quarters. Anyway, I was able to adapt your formula to my needs.
Thanks a lot!
Regards,
Yassaui