Forum Discussion
CALCULATE not showing correct count
- 10 years ago
hi there
I reached the solution (not the more elegant, but...)4ano = IF(SUM('f_tabelão'[PAX 4])>(CALCULATE(('d_AuxQtMáxPAX'[Qt Máx PAX contrato]);'f_tp Contrato FPSO'[Tp Contrato (anos)]=4));CALCULATE(((SUM('f_tabelão'[PAX 4])-('d_AuxQtMáxPAX'[Qt Máx PAX contrato]))*'d_custos vôos extras'[PAX Extra (só convert R$)]);'f_tp Contrato FPSO'[Tp Contrato (anos)]=4);0)
f_tabelão'[PAX 4] -> Unfortunately, I needed to create different columns for each year...
I only speak English, but if I am understanding the crux of your issue, it looks like you are using a Measure in your table. The thing with Measures in tables is that the Total line provides its own context for the Measure and the Measure respects that context. So, if in the context of the Total row, the Measure calculates to 0, that is what it will display. Measures in Total lines in tables do NOT simply add up the sum of the numbers in the column like a table using a Column would do.
@smoupre wrote:I only speak English, but if I am understanding the crux of your issue, it looks like you are using a Measure in your table. The thing with Measures in tables is that the Total line provides its own context for the Measure and the Measure respects that context. So, if in the context of the Total row, the Measure calculates to 0, that is what it will display. Measures in Total lines in tables do NOT simply add up the sum of the numbers in the column like a table using a Column would do.
Portuguese speaker here. Yes, that's exactly what he meant. He would like the total for that measure to display simply the sum of the numbers. Each row represents how much the monthly quota has been exceeded. He wants the sum - in that year - of the excess. Instead, the total sums up the monthly quotas and the actual consumption, indicating that the "total quota" hasn't been exceeded. Any ideas on how he can accomplish this?