Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Guys,
I am trying to move a calculation from a sql query to dax. I am able to calculate the number on a row level but i cannot get a total from it.
Here is my Dax:
Costo Oportunidad =
var precioventa =
LOOKUPVALUE(
Productos[Precio Venta],
Productos[Código Producto],
SELECTEDVALUE(
Desabasto[Producto]
)
)
var ventateorica7dias =
SUMX(
Desabasto,
(DIVIDE(
CALCULATE( SUM( Desabasto[Vtas30Días] ) ),
30
) - Desabasto[Existencias]) * precioventa
)
return
ventateorica7dias
Notice how the left column has a total and the right does not :
Thanks in advance
@reynaldo_malave
Can you try this modified version?
Costo Oportunidad =
VAR ventateorica7dias =
SUMX (
Desabasto,
( DIVIDE ( SUM ( Desabasto[Vtas30Días] ), 30 ) - Desabasto[Existencias] )
* LOOKUPVALUE (
Productos[Precio Venta],
Productos[Código Producto], Desabasto[Producto]
)
)
RETURN
ventateorica7dias
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |