This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
I need to make a stacked column chart where percentages are shown in the tooltips. I am having issues displaying percentages correctly. Data in excel shared
Solved! Go to Solution.
Hi @Ramagopal ,
For this you need to use a measure to change the different levels of the scope try the following code:
% TVR by Promo =
VAR CurrentSpotType = SELECTEDVALUE('New_Dash_Board'[Type])
VAR CurrentSpotMother = SELECTEDVALUE('New_Dash_Board'[Mother])
VAR CurrentPromo = SELECTEDVALUE('New_Dash_Board'[Promotional])
VAR Numerator =
SUM('New_Dash_Board'[sum(tvr)])
VAR Denominator =
SWITCH(
TRUE(),
ISINSCOPE(New_Dash_Board[Promotional]), CALCULATE(
SUM('New_Dash_Board'[sum(tvr)]),
REMOVEFILTERS(New_Dash_Board[Promotional]),
New_Dash_Board[Type] = CurrentSpotType
),
ISINSCOPE(New_Dash_Board[Type]), CALCULATE(
SUM('New_Dash_Board'[sum(tvr)]),
REMOVEFILTERS(New_Dash_Board[Type]),
New_Dash_Board[Mother] = CurrentSpotMother
),
ISINSCOPE(New_Dash_Board[Mother]), CALCULATE(
SUM('New_Dash_Board'[sum(tvr)]),
REMOVEFILTERS(New_Dash_Board[Mother])
)
)
RETURN
DIVIDE(
Numerator,
Denominator,
0
)
An easier option is to use a visual calculation that way you only need to write the following code:
TVR % = DIVIDE([Total] ,CALCULATE([Total] ,COLLAPSE(ROWS,1 )))
Has you can see result is the same:
https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Ramagopal ,
Could you let us know if your issue has been resolved or if you need any more information. We're here to help if you need further assistance.
Thank you.
Hi @Ramagopal ,
If you get a chance, please review the response shared by @MFelix , @krishnakanth240 and let us know if it aligns with your expectations. Should you need any additional details or clarification, feel free to let us know.
Thank you for your valuable input @krishnakanth240, @MFelix .
Regards,
Yugandhar.
Hi @Ramagopal
Can you try this measure
% TVR by Promo =
VAR CurrentMonth = SELECTEDVALUE(New_Dash_Board[month])
VAR CurrentSpotType = SELECTEDVALUE(New_Dash_Board[Type])
VAR Numerator = SUM(New_Dash_Board[sum(tvr)])
VAR Denominator = CALCULATE(
SUM(New_Dash_Board[sum(tvr)]),
FILTER(ALLEXCEPT(New_Dash_Board,
New_Dash_Board[month], New_Dash_Board[Type]),
New_Dash_Board[month] = CurrentMonth && New_Dash_Board[Type] = CurrentSpotType))
RETURN
DIVIDE(Numerator, Denominator, 0)
Hi @Ramagopal ,
For this you need to use a measure to change the different levels of the scope try the following code:
% TVR by Promo =
VAR CurrentSpotType = SELECTEDVALUE('New_Dash_Board'[Type])
VAR CurrentSpotMother = SELECTEDVALUE('New_Dash_Board'[Mother])
VAR CurrentPromo = SELECTEDVALUE('New_Dash_Board'[Promotional])
VAR Numerator =
SUM('New_Dash_Board'[sum(tvr)])
VAR Denominator =
SWITCH(
TRUE(),
ISINSCOPE(New_Dash_Board[Promotional]), CALCULATE(
SUM('New_Dash_Board'[sum(tvr)]),
REMOVEFILTERS(New_Dash_Board[Promotional]),
New_Dash_Board[Type] = CurrentSpotType
),
ISINSCOPE(New_Dash_Board[Type]), CALCULATE(
SUM('New_Dash_Board'[sum(tvr)]),
REMOVEFILTERS(New_Dash_Board[Type]),
New_Dash_Board[Mother] = CurrentSpotMother
),
ISINSCOPE(New_Dash_Board[Mother]), CALCULATE(
SUM('New_Dash_Board'[sum(tvr)]),
REMOVEFILTERS(New_Dash_Board[Mother])
)
)
RETURN
DIVIDE(
Numerator,
Denominator,
0
)
An easier option is to use a visual calculation that way you only need to write the following code:
TVR % = DIVIDE([Total] ,CALCULATE([Total] ,COLLAPSE(ROWS,1 )))
Has you can see result is the same:
https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCheck out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |