Forum Discussion
Stacked bar chart with three customer group types: Internal, Prior Year Loss, and New Year Loss.
- 9 months ago
@riteshmen , -Prior year loss-making customers and -New year loss-making customers seems to measures not column values. In such case we have two option, we create measure and create calculation group and use that. Or we do Dynamic segmentation
example
Learn Power BI Advance - Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q:Calculation Groups (Can now be created in Desktop)- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0
Hi riteshmen ,
try below column :
CustomerGroupNew = SWITCH(TRUE(),
'GL+GF'[Customer Group]<>"internal" && 'GL+GF'[GP]<0 && YEAR('GL+GF'[MonthYY])=YEAR(TODAY())-1,"Prior Year Loss-Making Customer",
'GL+GF'[Customer Group]<>"internal" && 'GL+GF'[GP]<0 && YEAR('GL+GF'[MonthYY])=YEAR(TODAY()),"New Year Loss-Making Customer",
'GL+GF'[Customer Group]
)Then use this column for stacked column chart as legend.in legend,exclude blank(blank represents customer whose GP is positive).
Please give kudos or mark it as solution once confirmed.
Thanks and regards,
Praful
This is a calculated column which is not providing the correct output. I want to show the customer group count and differentiate it as internal,prior and new based on the monthyy selection. so it should be dynamic.
- amitchandak9 months ago
Super User
@riteshmen , -Prior year loss-making customers and -New year loss-making customers seems to measures not column values. In such case we have two option, we create measure and create calculation group and use that. Or we do Dynamic segmentation
example
Learn Power BI Advance - Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q:Calculation Groups (Can now be created in Desktop)- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0
- V-yubandi-msft9 months ago
Community Support
Hi riteshmen ,
amitchandak, pointed out correctly that this logic needs to be dynamic a calculated column won’t handle the time based grouping.
He also shared a useful link on dynamic segmentation, which is relevant for this scenario.Please take a moment to review it and let us know if you need any additional information.
Thank you.