Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Syndicate_Admin
Administrator
Administrator

Valor total diferente al esperado

Hola, chicos. Estoy intentando hacer una medida de dax que devuelva el valor de ventas de los productos que están en el rango de antigüedad "De 91 a 120 días", es decir, el valor de venta de los productos que tienen la fecha más reciente en la tabla fInventario con fInventario[Rango de envejecimiento] = "De 91 a 120 días". En la imagen de abajo tengo lo más cerca que pude llegar al resultado esperado. Pude devolver los productos deseados y el valor de venta, pero los totales son diferentes. ¿Alguien puede ayudarme?

gelsonwirtijr_0-1739198030023.png

gelsonwirtijr_2-1739198158014.png

Mi medida:

VAR FechaMás Reciente =
CALCULAR(
MÁXIMO(fInventario[Fecha]),
TODOSEXCEPTO(fInventario, fInventario[ProductId])
)
VAR VerificaEnvejecimiento =
CALCULAR(
COUNTROWS(fInventario),
FILTRO(
fInventario,
fInventario[Fecha] = FechaRecienteMaíz &&
fInventario[Range de aging] = "De 91 a 120 días" &&
[Valor actual de las acciones] > 0
),
TODOSEXCEPTO(fInventario, fInventario[ProductId])
)
DEVOLUCIÓN
SI(VerificaAging > 0, [Ventas brutas], ESPACIO EN BLANCO())



Resultado esperado:

gelsonwirtijr_1-1739198061657.png

gelsonwirtijr_3-1739198172350.png

PBIX está disponible en:
https://drive.google.com/drive/folders/1LwzYKVU4xDD5KfXCiLVN_c70LT6xG3bc?usp=sharing

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@gelsonwirtijr , Intente usar

SalesValueAgingRange =
VAR FechaRecienteMaíz =
CALCULAR(
MAX(fInventario[Fecha]),
ALLEXCEPT(fInventario, fInventario[ProductId])
)
Verificación VARVenvejecido =
CALCULAR(
COUNTROWS(fInventario),
FILTRO(
fInventario,
fInventario[Fecha] = FechaRecienteMaíz &&
fInventario[Rango de envejecimiento] = "De 91 a 120 dias" &&
[Valor estoque atual] > 0
),
ALLEXCEPT(fInventario, fInventario[ProductId])
)
Valor de ventas de VAR =
IF(VerifyAging > 0, [Vendas brutas], BLANK())
DEVOLUCIÓN
SUMX(
VALUES(fInventory[ProductId]),
Valor de ventas
)

No funcionó
gelsonwirtijr_0-1739200357239.png

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors