Forum Discussion

sjors_bi's avatar
sjors_bi
New Member
1 year ago
Solved

conversion/penetration/retention/churn report

  I've got a database on a daily level. I want to calculate the conversion/penetration/retention/churn per month per product group. I finally thought this would be easy with the new visual c...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from lbendlin  please allow me to provide another insight:

    Hi, sjors_bi 
    Thanks for reaching out to the Microsoft fabric community forum.

    1.Based on your description of the issue, it is because, in visual object calculations, similar to measures, an aggregate value is required as the output result. These calculations depend on the context within the data model, meaning they vary based on different rows. Therefore, in the total section, it also determines that the total value is non-zero, resulting in the default output of the conditional statement being false=blank, as shown in the image below:

    For further details, please refer to:
    Using visual calculations in Power BI Desktop - Power BI | Microsoft Learn

    Tutorial: Create your own measures in Power BI Desktop - Power BI | Microsoft Learn
     

    2.Correcting this result is straightforward, but it requires referencing a table, which is not supported in visual object calculations. Therefore, I recommend using a measure to replace your visual object calculation:

    conversion = 
    CALCULATE([cpr stems ty],FILTER('Table',[cpr stems ly] = 0 ))
    penetration = 
     CALCULATE([cpr stems ty]- [cpr stems ly],FILTER('Table',[cpr stems ly] > 0 && [change] >0))
    
    retention = IF( [change] <0  , [cpr stems ty], [cpr stems ly])
    churn = CALCULATE([change],FILTER('Table',[change] < 0))

    3.Here's my final result, which I hope meets your requirements.

     

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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