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
StuartSmith
Power Participant
Power Participant

"Filtered By" label

Is there a way to have, say a label or text box that displays what the report is filtered by, such as "Country"?

 

Filter status.png

and then if the user also filtered by "Status", the label would show "Country, Status" and so on.

1 ACCEPTED SOLUTION

@StuartSmith 

This is what you are after I think:

Filtered By = 
    VAR F1 = IF(ISFILTERED(Sales[product]), "Product, ",BLANK())
    VAR F2 = IF(ISFILTERED(Sales[customer]), "customer, ",BLANK())& F1
    VAR F3 = IF(ISFILTERED(Sales[Descriptor]), "Descriptor, ",BLANK()) & F2

RETURN

IF(
    ISBLANK(F3),
    "No filters selected",
    LEFT(F3,LEN(F3)-2)
)

 

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

@StuartSmith ,

if(isfiltered(Country[country]),"Filtered by Country","") , use this on a card

Anyone know how I can deveope this so it will show all slicers that have been selected?  I currently have 5 slicers called "ID", "Year", "Status", "Sub Region" and "Budget Group".

Thanks in advance

@StuartSmith 

Try this one (Modify as per your table and field names):

 

Filtered By = 
    VAR F1 = IF(ISFILTERED(Sales[product]), "Product",BLANK())
    VAR F2 = IF(ISFILTERED(Sales[customer]), "customer",BLANK())
    VAR F3 = IF(ISFILTERED(Sales[Descriptor]), "Descriptor",BLANK())

RETURN

F1 &", " &F2  &", "& F3

 

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy Thanks for that, got a modifications that I hope you can help with.

 

If no slicers selected it still displays multiple "," which doesnt look great or if Var 1 isnt filtered, but Var 2 is, then again the presentation is great. 

 

2020-07-14_15-27-30.png

2020-07-14_15-37-16.png

 

Is there a way to tidy up the presentsation so that it will only display a "," between 2 or more var's, etc, such as...

 

Filtered By: Var 1, Var 2

Filtered by: Var 2

 

Thanks,

@StuartSmith 

This is what you are after I think:

Filtered By = 
    VAR F1 = IF(ISFILTERED(Sales[product]), "Product, ",BLANK())
    VAR F2 = IF(ISFILTERED(Sales[customer]), "customer, ",BLANK())& F1
    VAR F3 = IF(ISFILTERED(Sales[Descriptor]), "Descriptor, ",BLANK()) & F2

RETURN

IF(
    ISBLANK(F3),
    "No filters selected",
    LEFT(F3,LEN(F3)-2)
)

 

If you are satisfied with my answer, please mark it as a solution so others can easily find it.

Don't forget to give KUDOS ? to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

That great! Thanks

@StuartSmith 

You are welcome!

 

Don't forget to give KUDOS 👍 to replies that help answer your questions


Subscribe to ExcelFort: Learn Power BI, Power Query and Excel

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I tried...


 

FilteredBy = if(ISFILTERED('export'[_OBO Year]),"ODB Year", IF(ISFILTERED('export'[_Status]), "Status", IF(ISFILTERED('export'[_Sub Region]), "Sub Region", IF(ISFILTERED('export'[_Budget Group]), "Budget Group", "No Filter Applied"))))​

but obviously, this simply displays only one of the results, i want all results to display if that filter is applied. 

 

 

I will try and figure this out, but any help would be great.

 

 

Thanks, thats great, is there a way to get it displaying multiple filters, such as "Filtered by: Country, City" etc. so it will display all slicers that are filtered?

 

Fowmy
Super User
Super User

Hi,

Try ISFILTERED function to create a measure and combine each slicer column to a text.

Refer to: https://docs.microsoft.com/en-us/dax/isfiltered-function-dax

Did I answer your question? Mark my post as a solution!

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.