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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tami
Frequent Visitor

Measure of Total as Column in Chart

Hello all,

 

I have already searched some forum posts, but most of the time the new total bar is the sum of an existing variable, in my case it would be a measure for which I would also need the total in the chart. Have also tried codes I found in the community forum, however they don't seem to work with Measures instead of variables or I just applied them wrong. But more specific:

 

Here is a small example dataset with the necessary variables q1.1 and the locations. The measure "q1.1 Measure T2B" calculates the percentage of the expressions 4 and 5. This calculation also works in Power BI and looks like this:

 

q1.1 Measure T2B =
(
( CALCULATE ( COUNT ( surveydata[q1.1] ), surveydata[q1.1] = 4 ) )
+ ( CALCULATE ( COUNT ( surveydata[q1.1] ), surveydata[q1.1] = 5 ) )
)
/ ( CALCULATE ( COUNT ( surveydata[q1.1] ), ALL ( surveydata[q1.1] ) ) )

 

Nr.q1.1Locations
142 - Standort A
242 - Standort A
322 - Standort A
432 - Standort A
542 - Standort A
652 - Standort A
752 - Standort A
842 - Standort A
952 - Standort A
1052 - Standort A
1142 - Standort A
1232 - Standort A
1352 - Standort A
1413 - Standort B
1523 - Standort B
1633 - Standort B
1713 - Standort B
18 3 - Standort B
1943 - Standort B
2033 - Standort B
2144 - Standort C
2234 - Standort C
2344 - Standort C
2444 - Standort C
2544 - Standort C
2644 - Standort C
2734 - Standort C
2834 - Standort C

 

I would need in this chart the breakdown by locations and the total of it. However, the percentages should not be added up here, but should also be calculated for the total. See screenshot below, where I have done this in a bar chart for total and a bar chart for the locations only in one.

tami_1-1661331281818.png

If there is already a solution and maybe I just couldn't apply it or didn't find the right thing, I'm sorry. I'm still quite new to the Power BI Game and still have a hard time with all the measures 😕

 

Thank you all in advance for your help! I really appreciate it

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tami,

You can refer to the following blog to know how to use filters to check the current row context level, then you can use if statements with these filters and expressions replace the original results.

Clever Hierarchy Handling in DAX - SQLBI

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @tami,

You can refer to the following blog to know how to use filters to check the current row context level, then you can use if statements with these filters and expressions replace the original results.

Clever Hierarchy Handling in DAX - SQLBI

Regards,

Xiaoxin Sheng

davehus
Memorable Member
Memorable Member

Hi @tami ,

 

To be clear, do you want the total of the table or the total of each stadort to get your % ratio?

 

 

tami
Frequent Visitor

Hi davehus,

 

thanks for your reply! I want the Total of the table (the 59%) in the chart by each Standort. So when the Measure is calculated for the whole table the result is the 59% and this should be also be a column in the chart with the 3 columns by standort. So that the current 2 charts as shown above are only one chart. Could that answer your question? 🙂

davehus
Memorable Member
Memorable Member

Hi @tami,

 

You could do something along the lines of individual measures for each survey and then the total>create a disconected table and used SWITCH to display the data but this would be dependant on how many surveys you have. 

 

There might be a visual either. I'm not 100% sure on this one.

 

Did I help you today? Please accept my solution and hit the Kudos button.

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.

Top Solution Authors