cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
charlie77
Helper II
Helper II

How to use the result of a slicer in a new column

Hi

I have a data table with three columns with headings of "A", "B", and "C", respectively, and a slicer with "A", "B" and "C" three options. I wish to create a forth column which deplicates "A", "B", or "C" depending on the selection of the slicer e.g. if select "A" in the slicer, the 4th column of the table will be a duplication of column "A". Is there anyone who could provide a solution?

 

Many thanks

Charlie77

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @charlie77 ,

According to my understand, the calculated column could not be dynamical ,so use the following measure instead:

 

duplication =
SWITCH (
    SELECTEDVALUE ( ForSlicer[SlicerValue] ),
    "A", MAX ( 'DuplicationTable'[A] ),
    "B", MAX ( 'DuplicationTable'[B] ),
    "C", MAX ( 'DuplicationTable'[C] )
)

9.9.3.1.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @charlie77 ,

According to my understand, the calculated column could not be dynamical ,so use the following measure instead:

 

duplication =
SWITCH (
    SELECTEDVALUE ( ForSlicer[SlicerValue] ),
    "A", MAX ( 'DuplicationTable'[A] ),
    "B", MAX ( 'DuplicationTable'[B] ),
    "C", MAX ( 'DuplicationTable'[C] )
)

9.9.3.1.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

Hi Eyelyn

Thank you so much for the ingenious solution. Yes, it's exactly what I wanted. 

Thanks again. 

Charlie77

amitchandak
Super User
Super User

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors