Forum Discussion

mrdwanm's avatar
mrdwanm
Frequent Visitor
5 years ago
Solved

How To Summarize Churn

Hello, 

i have calculate of churn for each customer.

and then i want to show the churn by customer type, but the total is 0.

 

How to show it? 
my dax query for churn 

Churn =
IF(AND([GMV] = 0 , [Sales LM] > 0),0 - [Sales LM],0)
 
*Sales LM = Sales Last Month

 

Thank you!

  • Hi mrdwanm,

     

    Try measure as:

    SUMX(
       filter(
             table,
             table[Year Month Type]=maxtable[Year Month Type]),
      [Churn]
    )

    If you still have some question, please don't hesitate to let me known.‌‌

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

5 Replies

  • m3tr01d's avatar
    m3tr01d
    Continued Contributor

    Can you 
    1) tell us all the dax code from the measures [GMV] and [Sales LM]
    2) put the measure [GMV] and [Sales LM] on the visual and show us a picture

    • mrdwanm's avatar
      mrdwanm
      Frequent Visitor

      Hi,

       

      Sure. Here'is the DAX code.

      GMV = IF(SUM(Retention[total_gmv]) = BLANK(), 0, SUM(Retention[total_gmv]))
      Sales LM = CALCULATE([GMV],DATEADD('Date'[Date],-1,MONTH))

       

       
  • m3tr01d's avatar
    m3tr01d
    Continued Contributor

    Can you add the Sales LM on this table and show me what you see?


    To debug further we might need to have your pbix file with some data 😕

    • mrdwanm's avatar
      mrdwanm
      Frequent Visitor

      Sorry, this the visual.

      i can't to upload the pbix file, because the data is sensitive.

       

       

  • v-xulin-mstf's avatar
    v-xulin-mstf
    Community Support

    Hi mrdwanm,

     

    Try measure as:

    SUMX(
       filter(
             table,
             table[Year Month Type]=maxtable[Year Month Type]),
      [Churn]
    )

    If you still have some question, please don't hesitate to let me known.‌‌

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!