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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

replace value for a certain slicer selection

Dear all,

 

I have the following situation:

I have item 1 of product class A and want to compare it to other items.

I have a slicer to select product classes for the compare items with the options A, B, C, All classes, automatic.

In the case of "Automatic", the filter should automatically chose the product class of item 1 for the compare items, in this case product class A

So far, I have a measure 

product measure = CONCATENATEX(VALUES('Produkt_Options'[Produkt]);'Produkt_Options'[Produkt];",") 
to join all options together 
e.g. when I select A and B in the slicer, I get A,B
when I choose Automatic, I get Automatic,   but I would like to get A
How can I  define what I want for the otpion automatic?
 
Kind regards
Susanne
1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a measure as below to work on it.

Measure = 
VAR se =
    SELECTEDVALUE ( 'Table'[Option] )
RETURN
    IF (
        NOT ( ISFILTERED ( 'Table'[Option] ) ),
        BLANK (),
        IF ( se = "Automatic", "A", CONCATENATEX ( 'Table', 'Table'[Option], "," ) )
    )

Capture.PNG

 

Pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a measure as below to work on it.

Measure = 
VAR se =
    SELECTEDVALUE ( 'Table'[Option] )
RETURN
    IF (
        NOT ( ISFILTERED ( 'Table'[Option] ) ),
        BLANK (),
        IF ( se = "Automatic", "A", CONCATENATEX ( 'Table', 'Table'[Option], "," ) )
    )

Capture.PNG

 

Pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
kentyler
Solution Sage
Solution Sage

You can use an expression for concantenatex

CONCATENATEX(Employees, [FirstName] & “ “ & [LastName], “,”)

so use ....IF('Produkt_Options'[Produkt]="Automatic",[measure to look up product class of first item],'Produkt_Options'[Produkt])

 

I'm a personal Power Bi Trainer I learn something every time I answer a question

The Golden Rules for Power BI

  1. Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. https://www.youtube.com/watch?v=FxiAYGbCfAQ
  2. Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! https://www.youtube.com/watch?v=1Kilya6aUQw
  3. Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.
  4. Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result  to check on your steps along the way.




Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors