Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Display data from different columns in one column based on slicer

I have a situation where the user needs to select between two possible options (in a slicer, presumably), and based on their selection, we then decide which column should populate the column of a tab...
  • v-lid-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    In your scenario, there should be a unique column to show the table normally, there is also a unique column in the post you found called catagory, you can try to delete the column and you will find the table cannot show completely.

     

    If you do not have such a column, you can use power query editor to index it, for examle, i use the suffix as the unique column and create a measure like this,

     

    AC/BIC = 
    IF (
        SELECTEDVALUE ( 'Choose Account'[Source] ) = "AC",
        LOOKUPVALUE ( Sheet1[AC], Sheet1[INDEX], SELECTEDVALUE ( Sheet1[INDEX] ) ),
        IF (
            SELECTEDVALUE ( 'Choose Account'[Source] ) = "BIC",
            LOOKUPVALUE ( Sheet1[BIC], Sheet1[INDEX], SELECTEDVALUE ( Sheet1[INDEX] ) )
        )
    )

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ DongLi
    If this post helps, then please consider Accept it as the solution to help the other members find it more