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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to show the consolidated bars in Power BI

Hello Expert

We have LOCATION Table(column name - LOCATION_NAME) having three values INDIA,USA & UK.

My requirement is to show Consolidated in drop down as well as X-axis in report.

 

Logic is:
if we select India & UK & USA that value need to pass in Consolidated and show the total of all the three.
, if we select India & USA that value need to pass in Consolidated and show the total of all the two.

 

Can you please suggest how to do this in Power BI.

 

Thanks,How to add consolidated barHow to add consolidated bar

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Check this solution, hope it works for you. I added a new value to the Countries dimension and added a condition in the measure for the total. You may need to look at other measures where the countries dimension is shown

 

You can download the file: HERE

 

Fowmy_1-1597737862940.png

 



________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@Anonymous 

Check this solution, hope it works for you. I added a new value to the Countries dimension and added a condition in the measure for the total. You may need to look at other measures where the countries dimension is shown

 

You can download the file: HERE

 

Fowmy_1-1597737862940.png

 



________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

There is a long-winded way that involves creating separate measures for each country. How good this is as a long-term solution really depends on how many countries you have to start with, and how likely/frequently countries will be changed/added/removed from your data.

 

Country value measures would look like this, replacing [LOCATION_NAME] for each different country:

 

_indiaValue =
CALCULATE(
    SUM(table[value]),
    KEEPFILTERS(table[LOCATION_NAME] = "India")
)

 

 

Consolidated measure would be something like this:

 

_consolidatedValue =
CALCULATE(
    SUM(table[value]),
    ALLSELECTED(table[LOCATION_NAME])
)

 

 

*EDIT* Added KEEPFILTERS() to location measures to override CALCULATE() implicit ALL().

Also note: this technique limits formatting of visuals as each location measure must be added in the Values section, therefore you lose the axis information and may struggle to get columns to fill the visual in an appealing way.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.