Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

% of Total is not working with parameter

Hi, Power BI community!
 
I have a Power BI dashboard with a group of Bar charts with dynamic field in the legend (there are two values) and I have a measure which calculates the % of total for this charts (this parameter in legend is not used in the calculations)
Here is the measure:
% of Total by Market = DIVIDE([Revenue Exchanged], CALCULATE([Revenue Exchanged], ALLEXCEPT(Table1, Table1[market])),0)
 
The problem is, when I switch the legend parameter, this calculation stops working, so it works only with the first value, but shows 100% for everything when parameter value is changed, could someone help with that?
 
Here is the parameter:
Bar charts parameter = {
("Group1", NAMEOF('Table1'[field1]), 0),
("Group2", NAMEOF('Table2'[field2]), 1)
}
 
Thanks in advance!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Everyone, I found a solution to this:

% of Total by Market =
IF
(SELECTEDVALUE('Parameter name'[Parameter Fields]) = "'table1'[field1]",
DIVIDE([Revenue Exchanged c], CALCULATE([Revenue Exchanged c], ALLEXCEPT(table1, table1[market]))),
DIVIDE([Revenue Exchanged],CALCULATE([Revenue Exchanged],ALLEXCEPT(table2,table2[market]))))

Working with parameters can be tough sometimes

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Everyone, I found a solution to this:

% of Total by Market =
IF
(SELECTEDVALUE('Parameter name'[Parameter Fields]) = "'table1'[field1]",
DIVIDE([Revenue Exchanged c], CALCULATE([Revenue Exchanged c], ALLEXCEPT(table1, table1[market]))),
DIVIDE([Revenue Exchanged],CALCULATE([Revenue Exchanged],ALLEXCEPT(table2,table2[market]))))

Working with parameters can be tough sometimes
Anonymous
Not applicable

Hi @Anonymous ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.