Forum Discussion

GracieLeeMonroe's avatar
GracieLeeMonroe
Frequent Visitor
4 years ago
Solved

Help needed with COUNTIF in DAX

All Problem:  I need to allocate the discount to invoice line items, but there are cases when the discount is credited in separate credit memo and has only one invoice line as a result. Then I need...
  • GracieLeeMonroe's avatar
    4 years ago

    All, 

     

    found it, here is the DAX Command I used:

     

    IF(AND(Table1[Discount]="Discount", Calculate(COUNTROWS(Table1),ALLEXCEPT(Table1,Table1[serviceMonth],Table1[invoiceNumber]))>1),0, Table1[Sum of Total]+Table1[AllocatedDiscountPerInvoiceLine])

     

    Have a great day!

     

    Regards

    GracieLee