Forum Discussion
Invoice / Payment Status Using DAX or Measure
- Anonymous2 years ago
Hi InsightSeeker ,
Thank you for pointing out my problem!The following DAX might work for you:
Measure = VAR _Inv = SELECTEDVALUE(Sale_1[Inv_Amount]) VAR _Paid = CALCULATE(MAX(Sale_1[Paid_Amount]),ALLEXCEPT(Sale_1,Sale_1[Inv_No])) VAR _Sale = CALCULATE(SUM(Sale_1[Sale_Amount]),ALLEXCEPT(Sale_1,Sale_1[Inv_No])) RETURN IF(_Paid < _Sale , IF(_Paid = 0 , "Unpaid" , "Partially Paid"),"Paid")The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi InsightSeeker ,
The following DAX might work for you:
Measure =
VAR _Inv = SELECTEDVALUE(Sale_1[Inv_Amount])
VAR _Paid = SELECTEDVALUE(Sale_1[Paid_Amount])
RETURN
IF(_Paid < _Inv ,
IF(_Paid = 0 , "Unpaid" , "Partially Paid"),
"Paid")
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- InsightSeeker2 years agoHelper III
Hi Anonymous - This measure returns the incorrect status for the Invoice 778807. This invoice is partially paid whereas for one sale it is showing paid.
- InsightSeeker2 years agoHelper III
Hi Anonymous - My result should be as below.
- Anonymous2 years agoNot applicable
Hi InsightSeeker ,
Thank you for pointing out my problem!The following DAX might work for you:
Measure = VAR _Inv = SELECTEDVALUE(Sale_1[Inv_Amount]) VAR _Paid = CALCULATE(MAX(Sale_1[Paid_Amount]),ALLEXCEPT(Sale_1,Sale_1[Inv_No])) VAR _Sale = CALCULATE(SUM(Sale_1[Sale_Amount]),ALLEXCEPT(Sale_1,Sale_1[Inv_No])) RETURN IF(_Paid < _Sale , IF(_Paid = 0 , "Unpaid" , "Partially Paid"),"Paid")The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.