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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Table Column Value based on Slicer Selection

I read a seperate post on a similar topic, and I am not sure whether this is possible, but I would like to have columns in a table that are linked to a slicer selection.

 

I have mapped out the scenario below:

 

Slicer Selection 1: One Value from; Country, Continent, Product, Category

Slicer Selection 2: One Value from; Country, Continent, Product, Category

 

Table A - Slicer Column 1: SWITCH,

Country, Table A [Country]

Continent, Table A [Continent]

Product, Table A [Product]

Category, Table A [Category]

 

All of the values I would like to switch between are contained in the same table (Table A), but with the addition of these columns, I can add this field into Rows and it would allow for dynamic selection.

 

Hopefully the scenario is fairly clear, and I am happy to hear different workarounds.

2 ACCEPTED SOLUTIONS
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can roughly understand your requirement, I think you can only use measures to achieve this because calculated columns can’t be affected by the slicer and the measure can’t be changed based on the selections of slicer, you can try my steps:

  1. Create a table for the slicer and don’t give them a relationship:

v-robertq-msft_0-1621587129775.png

v-robertq-msft_1-1621587129792.png

 

  1. Create two measures in the main table:
Selected column1 =

var _selectedvalue=SELECTCOLUMNS('Slicer',"1",[Name])

return

SWITCH(

    TRUE(),

    "Country" in _selectedvalue,MAX('Table'[Country]),

    "Continent" in _selectedvalue,MAX('Table'[Continent]),

    "Product" in _selectedvalue,MAX('Table'[Product]),

    "Category" in _selectedvalue,MAX('Table'[Catrgory]),

    BLANK())
Selected column2 =

var _selectedvalue=SELECTCOLUMNS('Slicer',"1",[Name])

return

SWITCH(

    TRUE(),

    "Category" in _selectedvalue,MAX('Table'[Catrgory]),

    "Product" in _selectedvalue,MAX('Table'[Product]),

    "Continent" in _selectedvalue,MAX('Table'[Continent]),

    "Country" in _selectedvalue,MAX('Table'[Country]),

    BLANK())
  1. Create a slicer and a table chart and place them like this:

v-robertq-msft_2-1621587129798.png

 

And you can get what you want.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your sample picture, I can roughly understand your problem, I think the true reason for your problem is that you didn’t place another column to distinguish the identical rows in these two columns, I think you can try to place the [Sales] column into the table chart and set as “Don’t summarize” to make it work:

This is my modified test data:

v-robertq-msft_0-1621837660946.png

 

I set the table chart like this:

v-robertq-msft_1-1621837660959.png

 

And you can get what you want.

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your sample picture, I can roughly understand your problem, I think the true reason for your problem is that you didn’t place another column to distinguish the identical rows in these two columns, I think you can try to place the [Sales] column into the table chart and set as “Don’t summarize” to make it work:

This is my modified test data:

v-robertq-msft_0-1621837660946.png

 

I set the table chart like this:

v-robertq-msft_1-1621837660959.png

 

And you can get what you want.

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can roughly understand your requirement, I think you can only use measures to achieve this because calculated columns can’t be affected by the slicer and the measure can’t be changed based on the selections of slicer, you can try my steps:

  1. Create a table for the slicer and don’t give them a relationship:

v-robertq-msft_0-1621587129775.png

v-robertq-msft_1-1621587129792.png

 

  1. Create two measures in the main table:
Selected column1 =

var _selectedvalue=SELECTCOLUMNS('Slicer',"1",[Name])

return

SWITCH(

    TRUE(),

    "Country" in _selectedvalue,MAX('Table'[Country]),

    "Continent" in _selectedvalue,MAX('Table'[Continent]),

    "Product" in _selectedvalue,MAX('Table'[Product]),

    "Category" in _selectedvalue,MAX('Table'[Catrgory]),

    BLANK())
Selected column2 =

var _selectedvalue=SELECTCOLUMNS('Slicer',"1",[Name])

return

SWITCH(

    TRUE(),

    "Category" in _selectedvalue,MAX('Table'[Catrgory]),

    "Product" in _selectedvalue,MAX('Table'[Product]),

    "Continent" in _selectedvalue,MAX('Table'[Continent]),

    "Country" in _selectedvalue,MAX('Table'[Country]),

    BLANK())
  1. Create a slicer and a table chart and place them like this:

v-robertq-msft_2-1621587129798.png

 

And you can get what you want.

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@v-robertq-msft  This is really close to being perfect.

 

When I apply the logic in the file the only issue is that my data has repeated values in the main table as per the below screenshot

 

Data.JPG

 

When I then put this into the Matrix I get a table which looks like the below pivot table. If I remove the ID column, then I get single line which only shows the last value for the column (due to the MAX() formula).

 

Is there any way to work around this?

Matrix View.JPG

 

 

amitchandak
Super User
Super User

@Anonymous , if you are planning to create a calculated column in the table using the slicer value, that is not possible. You have think in term of measures

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors