Forum Discussion
ClaudioF
1 year agoHelper II
cant find the problem in code
Hi everybody This porblem is driving me crazy, i have two dashboards with the same dax codes, the thing is, in one it works properly, in the other it does not and i just can't find out why. the dash...
Anonymous
1 year agoNot applicable
Hi ClaudioF ,
Please try:
ItemStatus =
VAR CurrentItem =
SELECTEDVALUE ( DB_ORDERS[Produto] )
VAR CurrentOrderNum =
SELECTEDVALUE ( DB_ORDERS[Pedido] )
VAR StockAvailable =
CALCULATE (
SUM ( 'Table Estoq'[Estoque Real] ),
'Table Estoq'[Produto] = CurrentItem
)
VAR RunningStock =
CALCULATE (
SUM ( 'DB_ORDERS'[Quant. Falta] ),
FILTER (
ALLSELECTED ( 'DB_ORDERS' ),
'DB_ORDERS'[Produto] = MAX ( 'DB_ORDERS'[Produto] )
&& 'DB_ORDERS'[Data Limite] <= MAX ( 'DB_ORDERS'[Data Limite] )
)
)
RETURN
IF (
RunningStock <= StockAvailable
&& MAX ( DB_ORDERS[Quant. Falta] ) <= StockAvailable,
"available",
"out"
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum