Forum Discussion

ROG's avatar
ROG
Responsive Resident
2 years ago

dax help

I am trying to calculate net churn: (gross churn - reactivations) / base

but if reactivations are greater than gross churn, I want it to return 0 

so basically the numerator would be something like: max((gross churn - reactivations), 0) But can’t figure it out .

 

Thanks!

2 Replies

  • ROG , Please try below DAX

     

    Net Churn =
    VAR GrossChurn = SUM('YourTable'[GrossChurn])
    VAR Reactivations = SUM('YourTable'[Reactivations])
    VAR Base = SUM('YourTable'[Base])
    RETURN
    IF(
    Base = 0,
    0,
    MAX((GrossChurn - Reactivations), 0) / Base
    )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ROG ,
    After all this time, has your problem been resolved, or has a new issue arisen? If you haven't solved it yet, you can upload your instance data or pbix file, which will help to solve your problem faster.

    Hope it helps!

    Best regards,
    Community Support Team_ Tom Shen

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.