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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

USING CONCATENATEX IN A DYNAMIC TITLE FOR MULTIPLE SLICERS

So I have a dynamic title which concatenates values which are selected from a slicer. If no slicer is selected, the title is blank. 

However - my DAX measure only accounts for a single slicer being filtered, and I have four.

The slicer is called 'UNDERWRITER' in a table called 'REVIEWS'

Here is my measure: 

FILTERED TITLE = IF(ISFILTERED('REVIEWS'[UNDERWRITER]),"ERROR SPLIT BY - "& CONCATENATEX(VALUES('REVIEWS'[UNDERWRITER]),'REVIEWS'[UNDERWRITER],", "),"")

In addition to 'UNDERWRITER', there are three other slicers from the 'REVIEWS' table that my users can choose from. Call them 'SLICER_A'  'SLICER_B'  'SLICER_C' 

Can I incorporate these into the same measure? 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous if you have formatted the code correctly you could have figured it out. You were almost there:

 

FILTERED TITLE =
IF (
    ISFILTERED ( 'REVIEWS'[UNDERWRITER] )
        || ISFILTERED ( 'REVIEWS'[NEW BUSINESS/RENEWAL] )
        || ISFILTERED ( 'REVIEWS'[CLAIM BASIS] )
        || ISFILTERED ( 'REVIEWS'[REGION] ),
    "ERROR SPLIT FOR - "
        & CONCATENATEX ( VALUES ( 'REVIEWS'[UNDERWRITER] ), 'REVIEWS'[UNDERWRITER], ", " )
        & CONCATENATEX (
            VALUES ( 'REVIEWS'[NEW BUSINESS/RENEWAL] ),
            'REVIEWS'[NEW BUSINESS/RENEWAL],
            ", "
        )
        & CONCATENATEX ( VALUES ( 'REVIEWS'[CLAIM BASIS] ), 'REVIEWS'[CLAIM BASIS], ", " )
        & CONCATENATEX ( VALUES ( 'REVIEWS'[REGION] ), 'REVIEWS'[REGION], ", ", "" )
)

 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@Anonymous glad it worked out and you learned something new., Feel free to subscribe to my YouTube channel, I post interesting (corner case) Power BI solution/tricks. Cheers!!

 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous and the reason for that is because all the slicers are from the same table if you have a separate dimension it would have been easier. Check this video on my YT channel and see if that helps and take you out from the mess 😁

https://youtu.be/CiqxnAGvv-c 

 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k I get it. That's a pain, I see why it's doing it - but I think DAX should allow you to specify because 9/10 you're not going to want to display EVERYTHING if you've just filtered one thing. 

Thanks so much for your help on this, I have learnt a lot!

parry2k
Super User
Super User

@Anonymous if you have formatted the code correctly you could have figured it out. You were almost there:

 

FILTERED TITLE =
IF (
    ISFILTERED ( 'REVIEWS'[UNDERWRITER] )
        || ISFILTERED ( 'REVIEWS'[NEW BUSINESS/RENEWAL] )
        || ISFILTERED ( 'REVIEWS'[CLAIM BASIS] )
        || ISFILTERED ( 'REVIEWS'[REGION] ),
    "ERROR SPLIT FOR - "
        & CONCATENATEX ( VALUES ( 'REVIEWS'[UNDERWRITER] ), 'REVIEWS'[UNDERWRITER], ", " )
        & CONCATENATEX (
            VALUES ( 'REVIEWS'[NEW BUSINESS/RENEWAL] ),
            'REVIEWS'[NEW BUSINESS/RENEWAL],
            ", "
        )
        & CONCATENATEX ( VALUES ( 'REVIEWS'[CLAIM BASIS] ), 'REVIEWS'[CLAIM BASIS], ", " )
        & CONCATENATEX ( VALUES ( 'REVIEWS'[REGION] ), 'REVIEWS'[REGION], ", ", "" )
)

 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k yes you're totally right. I see what I did wrong. I should have laid it out as you had, then I would have reaslised. 
What I have discovered now though, is that even if you select a single slicer, the measure is displaying every single option available from all the other slicers. For example if I select a region, the measure displays that region, plus all the underwriters that fall under that region - even if I haven't filtered 'UNDERWRITER'. It's a hot mess. Is there any way to tell the measure to only display the results that have been selected? 

I tried changing my measure to 'ISCROSSFILTERED' but that doesn't affect the result.

 

mahoneypat
Employee
Employee

You should be able to create a string for each slicer's values in separate variables (using same approach as you've shown), and then concatenate them with "&" in your Return.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

@mahoneypat I wish I was clever enough to figure out how to do this!

I tried the following but it stil only shows me the underwriter name, and the rest is just commas:

FILTERED TITLE = IF(ISFILTERED('REVIEWS'[UNDERWRITER])||ISFILTERED('REVIEWS'[NEW BUSINESS/RENEWAL])||ISFILTERED('REVIEWS'[CLAIM BASIS])||ISFILTERED('REVIEWS'[REGION]),"ERROR SPLIT FOR - "& CONCATENATEX(VALUES('REVIEWS'[UNDERWRITER]),'REVIEWS'[UNDERWRITER],", ")&CONCATENATEX(VALUES('REVIEWS'[NEW BUSINESS/RENEWAL]),", ")&CONCATENATEX(VALUES('REVIEWS'[CLAIM BASIS]),", ")&CONCATENATEX(VALUES('REVIEWS'[REGION]),", ",""))
amitchandak
Super User
Super User

@Anonymous ,  Try like

 

FILTERED TITLE = IF(ISFILTERED('REVIEWS'[UNDERWRITER]) || ISFILTERED('REVIEWS'[COLUMN A]) || ISFILTERED('REVIEWS'[COLUMN B])|| ISFILTERED('REVIEWS'[COLUMN C]) ,"ERROR SPLIT BY - "& CONCATENATEX(VALUES('REVIEWS'[UNDERWRITER]),'REVIEWS'[UNDERWRITER],", "),"")

 

Anonymous
Not applicable

Thanks @amitchandak but this still only displays the underwriter in the dynamic title. I need it to display - concatenated based on how many are selected from the slicer - whatever the user has selected. I tried adding || and & to the end as well but it errors.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors