Forum Discussion
last value with conditional (zero)
- 7 years ago
Hi igorabdo
If you want to have the average at the total there are two possibilities. I'm not sure which one you prefer.
One is that we take the average with the original zeros (i.e. without the filled-in values). Note that we are using the [Mesure_CUSTO] defined previously. You don't need to use it in the visual any longer but do keep the definition.
Measure_CUSTO_With_Avg@TotalWithOriginalZeros = IF ( ISFILTERED ( Table1[Mês Ano] ); [Measure_CUSTO]; AVERAGEX ( ADDCOLUMNS ( SUMMARIZE ( Table1; Table1[ITEMID]; Table1[Mês Ano] ); "Result"; CALCULATE ( SUM ( Table1[CUSTO] ) ) ); [Result] ) )
Hi igorabdo
If you want to have the average at the total there are two possibilities. I'm not sure which one you prefer.
One is that we take the average with the original zeros (i.e. without the filled-in values). Note that we are using the [Mesure_CUSTO] defined previously. You don't need to use it in the visual any longer but do keep the definition.
Measure_CUSTO_With_Avg@TotalWithOriginalZeros =
IF (
ISFILTERED ( Table1[Mês Ano] );
[Measure_CUSTO];
AVERAGEX (
ADDCOLUMNS (
SUMMARIZE ( Table1; Table1[ITEMID]; Table1[Mês Ano] );
"Result"; CALCULATE ( SUM ( Table1[CUSTO] ) )
);
[Result]
)
)
Hi AlB this is awesome !!
it worked well as a measure but can you help me for a column in the same logic. thanks !!