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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Ania26
Helper IV
Helper IV

Single select slicer

Hello,
I have a single select slicer *Dim_country=Country.
On the stacked bar chart I want to show values for all countries which belong to the same Region as selected country.
For example: single select country=France , so Region Europe.

Than on the chart I want to see all countires in Europe with some value.

1 ACCEPTED SOLUTION

I have a table called *Dim_Country with only country names.
Then I have another table Global Data with all data including Region , Country name and values of total consumption.

On the page I have slicer, single select which selects one country for example France and shows all data related to France on every chart.
I want to show where France is in relation to other countries in the same region, Europe, based on the Consumption. SO I want to have all counties in Europe including France. This is the only chart that shows any other countries. 

View solution in original post

8 REPLIES 8
cengizhanarslan
Super User
Super User

Step 1) Create a disconnected selector table

No relationship to anything. Use this as your slicer instead of Dim_country[Country].

CountrySelector =
DISTINCT (
    SELECTCOLUMNS ( Dim_country, "Selected Country", Dim_country[Country] )
)

 

Step 2) Update the measure

Region Total =
VAR _SelectedCountry =
    SELECTEDVALUE ( CountrySelector[Selected Country] )
VAR _SelectedRegion =
    CALCULATE (
        SELECTEDVALUE ( Dim_country[Region] ),
        Dim_country[Country] = _SelectedCountry
    )
RETURN
    CALCULATE (
        [Your Measure],
        REMOVEFILTERS ( Dim_country[Country] ),
        Dim_country[Region] = _SelectedRegion
    )

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

Hello, If I make another slicer for Country then I have two on one page. 

MFelix
Super User
Super User

Hi @Ania26 

 

Not sure if you have the value of the chart taking into consideration the region or the country. you may need to change the filter context of your calculations something similar to this:

 

Region Total =
  VAR RegionSelected = SELECTEDVALUE(Country[Region])
  Return
  CALCULATE(
             [Your Measure],
            REMOVEFILTER(Country[Country]),
            Country[Region] = RegionSelected
  )

Be aware that this is just a sample DAX that may need to be updated based on your model.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Hello,
This does not work. I have tried many different measures and still cannot solve this.

Hi @Ania26 ,

 

How do you have your visual setup, and also the country / region are they in the same table are they part of the a dimension table or a fact table?

 

I have made a small example has you can see belowe if I select a country the bar charts gets the total value of the region:

 

MFelix_0-1777969123772.png

 

MFelix_1-1777969147118.png

My measure is:

 

Total Sales Group = 
            VAR SalesGroup = SELECTEDVALUE('Sales Territory'[Group])
            Return
            CALCULATE(
                [Total Sales], 
                REMOVEFILTERS('Sales Territory'[Name]), 
                'Sales Territory'[Group] = SalesGroup)

 

Can you please give some more details so I can check what is the best approach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





I have a table called *Dim_Country with only country names.
Then I have another table Global Data with all data including Region , Country name and values of total consumption.

On the page I have slicer, single select which selects one country for example France and shows all data related to France on every chart.
I want to show where France is in relation to other countries in the same region, Europe, based on the Consumption. SO I want to have all counties in Europe including France. This is the only chart that shows any other countries. 

Hi @Ania26 ,

 

The problem that you have is related with the way you setup your chart,  since you want to show information at the country level and you are using the slicer on country level the visual will never show any other countries except the one that is selected.

 

To have this working you need to go for the solution that @cengizhanarslan  refer to have second table however in my opinion this table is not used for the select but for the axis on the chart that will allow you to get the correct value:

Total Sales Group = 
            VAR SalesGroup = SELECTEDVALUE('Sales Territory'[Group])
            Return
            CALCULATE(
                [Total Sales], 
                 'Sales Territory'[Name] = SELECTEDVALUE('Sales Territory Filter'[Name])
                 && SELECTEDVALUE('Sales Territory Filter'[Group]) = SalesGroup
                 )

Be aware that you may need to get the SalesGroup from the fact table,

 

MFelix_0-1777971421084.png

MFelix_1-1777971522247.png

 

In this case I have created a Sales Territory Filter that is a replica of the dimension I use for country.

 

The Slicer is gettign information from the dimension table and then on the bar chart I'm using the disconnected table to get the countries that way I keep a single slicer and that specific chart works has intended.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Thank you for help.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.