Forum Discussion

shermayne123's avatar
shermayne123
Helper I
2 years ago
Solved

Revenue vs Budget using Line and Stacked Column Chart

Hi, 

 

I have created a line and stacked column chart to allow users to see the monthly revenue against the budget, the shortfall or surplus if revenue is below or above budget. My chart looks like this:

 

So e.g. when user hovers over the bars in Jan, they are supposed to see that total revenue is 1.24m(data label on top of the bar), surplus is 0.1m(green bar) and budget is 1.14m(blue bar). When they hover over the bars in Apr, they will see that revenue is 0.48m(blue bar), shortfall is 0.66m(red bar) and budget is 1.14m(data label on top of the bar). 

 

My problem is when the revenue is above budget, the blue bar will still show it as monthly revenue, when the actual revenue is blue bar plus green bar and the blue bar is supposed to be the budget in this case. When revenue is below budget, there is no issue for the tooltips to show blue bar as the monthly revenue. Is there any way to make the tool tip for the blue bar dynamic, so it will reflect blue bar as the budget when the revenue is above budget, and as the revenue if it's below budget? Otherwise is there another better way to create the charts? My main requirement is for the revenue, shortfall or surplus to be stacked together with the data labels shown. Please let me know if you need further info. Thank you so much for any help!

  • MFelix's avatar
    MFelix
    2 years ago

    Hi shermayne123 ,

     

    In this case you need to take into account that the switch makes it based on  the order so for this you should do it the other way around start in tier 2 and end on tier 4.

    Shortfall = SWITCH(
        TRUE(),
        [Secured]<[Total Tier 2 Budget],[Secured]-[Total Tier 2 Budget],
        [Secured]<[Total Tier 3 Budget],[Secured]-[Total Tier 3 Budget],
        [Secured]<[Total Tier 4 Budget],[Secured]-[Total Tier 4 Budget]
    )

     

8 Replies

  • Hi shermayne123,

     

    How is the calculation for the blue bar done? If you are using different calculations when you over the blue bar you should get only the blue bar value.

     

    To what I can understand you want that the blue bar present the budget correct?

    • shermayne123's avatar
      shermayne123
      Helper I

      Hi Miguel,

       

      Thanks for responding and apologies for the delay.

       

      This is the formula I used for the blue bar: 

      Annual Secured = MIN([Total Forecasts],[Annual Tier 2 Budget])
       
      How do I get it to change to Annual Tier 2 Budget if the Total Forecasts is higher than the Annual Tier 2 Budget? In this case, the value is the Annual Tier 2 Budget but it's still showing the variable/measure name as Annual Secured. Thank you.
      • MFelix's avatar
        MFelix
        Super User

        Hi shermayne123 ,

         

        Based on what you wrote you just need name to have different names correct and the values are the ones that should be presented, is this assumption correct?

        In this case what I believe you need to do is to have different measures for the different values meaning:

        • Actuals Below Target = IF([Total Forecasts] > [Annual Tier 2 Budget],[Annual Tier 2 Budget])
        • Until target value = IF([Total Forecasts] > [Annual Tier 2 Budget],[Total Forecasts] - [Annual Tier 2 Budget])
        • Target Value = IF([Total Forecasts] <= [Annual Tier 2 Budget],[Total Forecasts])
        • Above Target Value = IF([Total Forecasts] <= [Annual Tier 2 Budget], [Annual Tier 2 Budget]-[Total Forecasts] )

        This will allow for different colour and different names on your visualization.