Forum Discussion
IsmaelConsult
3 years agoFrequent Visitor
Wrong Total
How can i fix my total in a matrix. The expresions are: Saldos:= CALCULATE(SUM(Saldos[Entrada])-SUM(Saldos[Saida])) Estoque:= VAR DATAINI=FIRSTDATE(ALL('Calendar'[Data])) VAR ...
IsmaelConsult
3 years agoFrequent Visitor
Greg_Deckler
I try with this metric:
Valor Estoque =
VAR UltimoCusto = CALCULATE(
LASTNONBLANK(Saldos[Preco_Custo_Medio]; 0);
VALUES(Produtos[Nome_Produto]);
FILTER(
ALL(Saldos);
Saldos[Data_Movimento] = MAX( Saldos[Data_Movimento])
);
ALL('Calendar')
)
VAR _VlrEstoque = [Saldo_Retro]*UltimoCusto
VAR _Table = SUMMARIZE(VALUES(Produtos[Nome_Produto]);"_value";_VlrEstoque)
RETURN
IF(HASONEVALUE(Produtos[Nome_Produto]);_VlrEstoque;SUMX(_Table;_VlrEstoque))
But not works.
But not works.
Greg_Deckler
3 years agoCommunity Champion
IsmaelConsult Can't do it like that, that's not how VAR's work. Use 2 separate measures like in the example.