Forum Discussion
BLM
8 years agoHelper I
Table total error
hello, i've maked a table with several measures. Specifically the measure "afabricar" don't want that show negatives values (if the result it's negative the valued must be zero). Well, if the me...
- 8 years ago
Hi BLM,
Try this formula, please. If it still doesn't work, please share your file or a dummy sample.
afabricar = VAR temp = IF ( SUM ( Productos[smincorregido] ) = 0; [sminnew]; SUM ( Productos[smincorregido] ) ) - [stockactual] + IF ( [totalconsumos] < [sminnew]; [sminnew]; [totalconsumos] ) - 'ops+stocks+cargas'[opspdts] RETURN IF ( HASONEVALUE ( 'TableName'[codnombre] ); IF ( temp < 0; 0; temp ); SUMX ( SUMMARIZE ( 'TableName'; 'TableName'[codnombre]; "temp1"; IF ( SUM ( Productos[smincorregido] ) = 0; [sminnew]; SUM ( Productos[smincorregido] ) ) - [stockactual] + IF ( [totalconsumos] < [sminnew]; [sminnew]; [totalconsumos] ) - 'ops+stocks+cargas'[opspdts] ); [temp1] ) )Best Regards,
Dale
BLM
8 years agoHelper I
I'm tryed out your formula, and the result it's the same. Show the negatives values and the "Total" it's Ok, but the question is that don't show the negatives values but 0.
v-jiascu-msft
8 years agoMicrosoft Employee
Hi BLM,
Try this formula, please. If it still doesn't work, please share your file or a dummy sample.
afabricar =
VAR temp =
IF (
SUM ( Productos[smincorregido] ) = 0;
[sminnew];
SUM ( Productos[smincorregido] )
)
- [stockactual]
+ IF ( [totalconsumos] < [sminnew]; [sminnew]; [totalconsumos] )
- 'ops+stocks+cargas'[opspdts]
RETURN
IF (
HASONEVALUE ( 'TableName'[codnombre] );
IF ( temp < 0; 0; temp );
SUMX (
SUMMARIZE (
'TableName';
'TableName'[codnombre];
"temp1"; IF (
SUM ( Productos[smincorregido] ) = 0;
[sminnew];
SUM ( Productos[smincorregido] )
)
- [stockactual]
+ IF ( [totalconsumos] < [sminnew]; [sminnew]; [totalconsumos] )
- 'ops+stocks+cargas'[opspdts]
);
[temp1]
)
)Best Regards,
Dale