Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Working with What If Parameters

Hi everyone,

 

I'm pretty new to Power BI and trying to set up a what if parameter for churn. The churn definition is that if an order has not been placed in over 90 days, that account has churned. There is data for 5 years in the dataset. I created a what if parameter called 'Has_churned' with the following - 

Has_churned = GENERATESERIES(90, 365, 10) and
Has_churned Value = SELECTEDVALUE('Has_churned'[Has_churned], 90)
 
I then calculated the measure has_churned_test = 
IF(
         sum('Customer'[Days Since Last Purchase]) > Has_churned[Has_churned Value],
         "Churned",
         "Not Churned"
)
 
This works as a measure in a table which shows customer number, days since last purchase and has_churned_test.
 
But I don't know how to do anything else with it. The goal is to see a yearly breakdown graph of churn and be able to change that graph using the what if paramter. However, because churn_test is a measure, I can't add it to a graph legend. I tried creating a column for the same but the values there are always the default value of Has_churned Value and the slicer doesn't affect it at all.
 
Is there a way to count customer churn per year? Or some other way to show this data that is not a huge table/matrix?
 
Thank you so much!

2 Replies

  • Anonymous , to me, seem like you need these value as a parameter too, in that case, you have to create an independent  table with these two values and then join them in measure

    example

     

    Sumx(filter(values(Customer[Customer]) , [has_churned_test] = max(churned_table[Value])), [Amount] )

     

     

    Customer is grouping, Value Is measures. churned_table table has those two values as row

    refer

     

    Dynamic Segmentation Bucketing Binning
    https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


    Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandakThank you so much for sharing that!

       

      The thing is, I'd like the user to select the churn value, i.e., Has_churned[Has_churned Value] is the slicer that they'd be able to change and see how revenue changes.

       

      If I create a separate table, in this calc from your reply, max(churned_table[Value])), [Amount] ), what is 'Amount'?