Forum Discussion
CTan42
9 years agoHelper II
Remove Duplicates?
Below are my power bi sample. I am asked to create a dashboard to present the stat of left orders. For examples, i do a calculation: orders= calculate(count(ID)). The result shows there are 5 orders....
TomMartens
9 years agoSuper User
Hey,
without knowing yor business rules it's just guesswork, but the constraint "more than one row" has to be considered no matter what date is used.
Blank "Remaining Payment" rows are due to the "Goods in transit" concept, from my point of view these goods to not affect the remainig payment, but maybe you have another kpi that exactly describes the difference between "goods send" and "goods received".
Regards
TomMartens
9 years agoSuper User
Hey,
and as I was staring on the measure I would rewrite the measure for performance reason like so
Remaining Payment latestOrder optimized =
SUMX(
VALUES('OrdersPayment'[ID])
,
var latestOrderDate =
CALCULATE(MAX('OrdersPayment'[Date]))
var minRemainigPayment =
CALCULATE(MIN('OrdersPayment'[RemainingPayment]))
return
CALCULATE(
SUM('OrdersPayment'[RemainingPayment])
,'OrdersPayment'[Date] = latestOrderDate
,'OrdersPayment'[RemainingPayment] = minRemainigPayment
)
)Regards