Forum Discussion
EARLIER function not working
- 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
Anonymous Please post the same data (test data) in copiable format to replicate your issue and will be helpful to suggest any solution.
Is this one okay?
CompanyFieldTotalExploration/AppraisalDevelopmentQuarterSales Account
| Uzenmunaygaz | Uzen | 49,383 | 0 | 49,383 | Q1 2018 | UZENMUNAYGAS |
| Uzenmunaygaz | Uzen | 114,173 | 0 | 114,173 | Q2 2018 | UZENMUNAYGAS |
| Uzenmunaygaz | Uzen | 178,746 | 0 | 178,746 | Q3 2018 | UZENMUNAYGAS |
| Uzenmunaygaz | Uzen | 184,908 | 0 | 184,908 | Q4 2017 | UZENMUNAYGAS |
| Uzenmunaygaz | Uzen | 139,632 | 0 | 139,632 | Q3 2017 | UZENMUNAYGAS |
| Uzenmunaygaz | Uzen | 94,355 | 0 | 94,355 | Q2 2017 | UZENMUNAYGAS |
| Uzenmunaygaz | Uzen | 43,720 | 0 | 43,720 | Q1 2017 | UZENMUNAYGAS |
- v-cherch-msft7 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
- Anonymous7 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