Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Create custom data label showing weekly change

Hi All,

 

I have a dataset that contains information on what sales stage each customer is each week.

WeekCustomerStage
1GrapefruitLead
2GrapefruitNegotiation
3GrapefruitContract
1BellNegotiation
2BellNegotiation
3BellCompleted
etcetcetc

'So imagine something like this:

 

I have a clustered column visual which is always filtered to a week. So lets say its only showing week 4 data.

 

The X axis has Sales Stages.

 

e.g.

0% - Lead

20% - Approach

40% - Negotiation

60% - Agreement

80% - Contract

100% - Completed

 

The Y axis has the number of customers in each stage (Count of Customer). I want to have a data label that shows the week on week change. So in this instance we have Week 4 selected, I would like the data label to show the growth/reduction in amounts in each sales stage from week 3. Ala the pic below.

 

 

Hope ive made the problem clear enough to solve, let me know if you need more information

 

1 Reply

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    so ,

    the visual is always filtered to 1 week .

    +  

    the visual oin the x axiss shows the stages.

    you want per eachs tage, the week over week change as custom data label .

     

     

    one more thing,

    does the column week  have from 1 -- 53 weeks,per year or does it just continue nonstop ,?  45, 55, 56  ? 

     

    i will create the measure assuming that your week column contains data from week1 to week53 per each year

     

    sample data : 

     

    count ofcustomers for week2 =  3 

    count of customers for prev week  = 1 

    w over w = (3 - 1) / 1  = 2/1 = 200%

    ouptut : 

     

     

    measure : 

    Measure 5 = 
    
    var prev_week = 
    CALCULATE(
        COUNT(week_over_week[customer]),
        OFFSET(
            -1,
            CALCULATETABLE(
                SUMMARIZE(
                    week_over_week,
                    week_over_week[week]
                ),
                REMOVEFILTERS(week_over_week[week])
            ),
            ORDERBY(week_over_week[week] , ASC)
        )
    ) 
    
    
    return  (COUNT(week_over_week[customer]) - prev_week ) / prev_week

     

     

     

     

    If my answer helped sort things out for you, i would appreciate a thumbs up πŸ‘ and mark it as the solution βœ…
    It makes a difference and might help someone else too. Thanks for spreading the good vibes! πŸ€