Forum Discussion

jeffs9876's avatar
jeffs9876
New Member
9 years ago
Solved

CountIFS to Calculate Payment Number

Hello,   I have a table (Table A) where I am storing a userID, productID and paymentDate. I would like to use something similar to a countifs statement from excel to add another column with the pay...
  • Anonymous's avatar
    Anonymous
    9 years ago

    jeffs9876,

    In Power BI Desktop, create a calculated column using the following DAX.

    paymentNumber = CALCULATE(COUNTA(TableA[productID]),FILTER(TableA,TableA[userID]=EARLIER(TableA[userID])&&TableA[productID]=EARLIER(TableA[productID])&&TableA[paymentDate]<=EARLIER(TableA[paymentDate]))) 



    Regards,