Forum Discussion
gelsonwirtijr
1 year agoFrequent Visitor
total value different from expected
Hey guys. I'm trying to make a dax measure that returns the sales value of products that are in the aging range "From 91 to 120 days", that is, the sales value of products that have the most recent d...
bhanu_gautam
1 year agoSuper User
gelsonwirtijr , Try using
SalesValueAgingRange =
VAR DataMaisRecente =
CALCULATE(
MAX(fInventario[Data]),
ALLEXCEPT(fInventario, fInventario[IdProduto])
)
VAR VerificaAging =
CALCULATE(
COUNTROWS(fInventario),
FILTER(
fInventario,
fInventario[Data] = DataMaisRecente &&
fInventario[Range de aging] = "De 91 a 120 dias" &&
[Valor estoque atual] > 0
),
ALLEXCEPT(fInventario, fInventario[IdProduto])
)
VAR SalesValue =
IF(VerificaAging > 0, [Vendas brutas], BLANK())
RETURN
SUMX(
VALUES(fInventario[IdProduto]),
SalesValue
)
- gelsonwirtijr1 year agoFrequent Visitor
it didn't work