Forum Discussion
ThiagoProfitt
5 years agoFrequent Visitor
Running Totals AND SUM in the same Matrix
I'm currently developing a cash flow matrix and failed while trying to merge two measures in one (running totals and sum): My idea was to add boolean indicators (Calculado Column) as such: So...
- 5 years ago
Managed to fix it:
Had to add an Index column and edit the measure:Subtotal =
var Calculado= SELECTEDVALUE(Categorias[Calculado])
var ordemContexto = Max('Categorias'[Índice])
var ValorSubtotalresumo =
CALCULATE([Running Total],Filter(ALLNOBLANKROW('Categorias'), 'Categorias'[Índice] >= ordemContexto))
Return
SWITCH(
True(),
Calculado = 0, [Total],
Calculado = 1, ValorSubtotalresumo,
BLANK()
)
ThiagoProfitt
5 years agoFrequent Visitor
Managed to fix it:
Had to add an Index column and edit the measure:
Subtotal =
var Calculado= SELECTEDVALUE(Categorias[Calculado])
var ordemContexto = Max('Categorias'[Índice])
var ValorSubtotalresumo =
CALCULATE([Running Total],Filter(ALLNOBLANKROW('Categorias'), 'Categorias'[Índice] >= ordemContexto))
Return
SWITCH(
True(),
Calculado = 0, [Total],
Calculado = 1, ValorSubtotalresumo,
BLANK()
)