Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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 sce...
  • v-robertq-msft's avatar
    5 years ago

    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:

     

    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:

     

    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.

  • v-robertq-msft's avatar
    5 years ago

    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:

     

    I set the table chart like this:

     

    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.