Forum Discussion
Anonymous
4 years agoNot applicable
SWITCH WITH SUMX
Hello People!
I have two measure
First
TesteCad =
var DataInicial = MIN('Date'[Date])
var DataFinal = MAX('Date'[Date])
var _Lote = VALUES(LotDailyCadence[LotNumber])
Return
DIVIDE(
SUMX(FILTER(All(LotDailyCadence),LotDailyCadence[Date]>= DataInicial && LotDailyCadence[Date]<= DataFinal && LotDailyCadence[LotNumber] IN _Lote),LotDailyCadence[TotalProgrammableCadence]),1000)
Second
Second
TesteTotal =
var DataInicial = MIN('Date'[Date])
var DataFinal = MAX('Date'[Date])
var _Lote = VALUES(LotDailyCadence[LotNumber])
Return
DIVIDE(SUMX(FILTER(all(LotDailyCadence),LotDailyCadence[Date]= DataFinal && LotDailyCadence[LotNumber] IN _Lote),LotDailyCadence[Lots.TotalQuantity]),1000)
So, when a do a switch
Calculate =
SWITCH(TRUE(),[TesteCad]>[TesteTotal],[TesteTotal],[TesteCad])
my total is not correct
Someone can help me!
Thanks
Anonymous - Hopefully this pattern will work for you to accomplish the correct total:
Refer to Power BI: Totals Incorrect and how to Fix it - Finance BI (finance-bi.com)
2 Replies
- ChrisMendozaResident Rockstar
Anonymous - Hopefully this pattern will work for you to accomplish the correct total:
Refer to Power BI: Totals Incorrect and how to Fix it - Finance BI (finance-bi.com)
- AnonymousNot applicable
ChrisMendozaThank you very much, I adapted your idea and it worked!!! 😁😁 You Salve my day!!!!