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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
swolfe2
Helper I
Helper I

How to use different column value if slicer has selected value

My fact table is created like this:

DateCarrierScore
1/1/2024A1
1/2/2024A0.98
1/3/2024A0.95
1/1/2024B0.98
1/2/2024B0.95
1/3/2024B0.9

swolfe2_0-1721155808236.png

 

I have a single dimensional table like this:

CarrierCarrier Hide
ACarrier 1
BCarrier 2

swolfe2_1-1721155821829.png


There is a single slicer which uses the [Carrier] value from the dimensional table. I'm wanting to create some functionality within the report that if someone selects a [Carrier] value, then it will return that [Carrier] value for that specific row, but will return the corresponding [Carrier Hide] value for each other row.

I'm attempting to obfuscate non-selected rows with a different value if they are not selected, but leave the rows in place within the visual itself. So, if no slicer values are selected, it would return [Carrier]. If [Carrier] "A" is selected, it would return "A" for one row and "Carrier 2" for the next row, since [Carrier] "B" was not selected.

Any help/advice would be greatly appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @swolfe2

 

I noticed your message and I made some changes to the code:

 

First, create a table. And use the columns of the new table as slicers.

 

 

Slicer Table = SELECTCOLUMNS('Carrier', "carrier", 'Carrier'[Carrier])

 

 

 

Create a measure.

 

 

Selected Carrier = 
VAR SelectedCarrier = SELECTEDVALUE('Slicer Table'[carrier])
RETURN
IF(
    SELECTEDVALUE('Fact'[Carrier]) = SelectedCarrier,
    SELECTEDVALUE('Fact'[Carrier]),
    LOOKUPVALUE('Carrier'[Carrier Hide], 'Carrier'[Carrier], SELECTEDVALUE('Fact'[Carrier]))
)

 

 

 

Here is the result.

 

vnuocmsft_1-1721982990786.png

 

vnuocmsft_0-1721982973404.png

 
 

Regards,

Nono Chen

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
Anonymous
Not applicable

Hi @swolfe2

 

I noticed your message and I made some changes to the code:

 

First, create a table. And use the columns of the new table as slicers.

 

 

Slicer Table = SELECTCOLUMNS('Carrier', "carrier", 'Carrier'[Carrier])

 

 

 

Create a measure.

 

 

Selected Carrier = 
VAR SelectedCarrier = SELECTEDVALUE('Slicer Table'[carrier])
RETURN
IF(
    SELECTEDVALUE('Fact'[Carrier]) = SelectedCarrier,
    SELECTEDVALUE('Fact'[Carrier]),
    LOOKUPVALUE('Carrier'[Carrier Hide], 'Carrier'[Carrier], SELECTEDVALUE('Fact'[Carrier]))
)

 

 

 

Here is the result.

 

vnuocmsft_1-1721982990786.png

 

vnuocmsft_0-1721982973404.png

 
 

Regards,

Nono Chen

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

This did it! Thanks so much for the detailed solution and .pbix file.

Anonymous
Not applicable

Hi @swolfe2 

 

Try the following code:

 

Selected Carrier = 
VAR SelectedCarrier = SELECTEDVALUE('Dimensional Table'[Carrier])
RETURN 
IF(
    ISFILTERED('Dimensional Table'[Carrier])
    && 
    SELECTEDVALUE('Fact Table'[Carrier]) = SelectedCarrier, 
    SELECTEDVALUE('Fact Table'[Carrier]),
    LOOKUPVALUE('Dimensional Table'[Carrier Hide], 'Dimensional Table'[Carrier], SELECTEDVALUE('Fact Table'[Carrier]))
)

 

Regards,

Nono Chen

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

Thanks so much for looking into this, @Anonymous. Unfortunately, this solution doesn't quite do what I'm expecting. As an example, when there is no slicer slection, nothing is returned:

swolfe2_0-1721231051299.png

Filtering to Carrier A only has rows for Carrier A:

swolfe2_1-1721231073653.png


I have added the .pbix file to my Google Drive, and you can download it to experiment. Again, I do really appreciate the effort!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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