Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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!
Solved! Go to Solution.
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]
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @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?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel,
Thanks for responding and apologies for the delay.
This is the formula I used for the blue bar:
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:
This will allow for different colour and different names on your visualization.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel,
Thank you for the detailed formulae.
Yes you got it right that I want the names to show differently for different scenarios.
I've adjusted your formulae for my purpose as follows:
Surplus = IF([Actual]>[Total Tier 2 Budget],[Actual]-[Total Tier 2 Budget])
Hi @shermayne123 ,
For that you can use a SWITCH syntax were is the same as concatenated IF statments. would be something similar to:
Surplus =
SWITCH(
TRUE(),
[Actual]>[Total Tier 2 Budget],[Actual]-[Total Tier 2 Budget],
[Actual]>[Total Tier 3 Budget],[Actual]-[Total Tier 3 Budget],
...
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel,
Thanks for your advice!
With this switch function, how can I make it work for the shortfall from the tiers? I tried the following formula but it computes the difference from the highest tier instead of the nearest tier:
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]
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel,
Thanks so much for pointing out the correct way to compute the shortfall. Now I am able to present this results in a matrix table visual.
I've one related question i.e. if I want to present this in a stacked column chart format, how can I get the shortfall to be stacked on top of the actuals instead of being in the negative zone under the y-axis? And is it possible to have the nearest tier budget to be presented as a line/marker in the stacked column?
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
88 | |
86 | |
83 | |
65 | |
49 |
User | Count |
---|---|
127 | |
108 | |
88 | |
70 | |
66 |