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.
i there
Tks, I'll try to do this in English.
I do have a (giant) table with PAX flown dates and destinies (fig 1), and for each destiny I do have a maximum contract allowance (like a “pre-paid PAX flights”).
I need to check and SUM the PAX amount that were over the contract allowance for each year and per destiny. * obs: when we do have total flights bellow this contract allowance, this “credit” is not cumulative for the next period.
So, I can SUM the total PAX per year and per destiny (no problem), but when I try to calculate for a long period (such as 5 years), the Power BI calculate with the total allowance (ex: 5 x each year allowed) by the total PAX.
And I need to know the total extra-cost.
What can I do?