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
dancarr22
Helper V
Helper V

Apply ALL filter on a field - and then after that apply hard-coded filter on same field

Hello,

 

We have a table of tags which joins back to various tables. 

How would I rewrite the code below to apply ALL filter to OneData_Tags field TagType.  And then apply TagType = "Business Owner".  So, first need OneData_Tags table where we remove all filters on field TagType.  And then we apply a filter on that field where TagType="Business Owner".  

 

 

TagName_BusinessOwner_Grouped = CONCATENATEX(FILTER(OneData_Tags, OneData_Tags[TagType]="Business Owner"),OneData_Tags[TagName],", ")

 

 

Any help greatly appreciated,

Dan

 

 

 

 

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below.

 

TagName_BusinessOwner_Grouped =
CONCATENATEX (
    FILTER ( ALL ( OneData_Tags ), OneData_Tags[TagType] = "Business Owner" ),
    OneData_Tags[TagName],
    ", "
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim thanks for your response!  This is close to what we need - but not exactly correct.  Apologies for not initially explaining this clearly.   The required fix seems to be in the first function call - we don't want to remove filters for ALL fields - just remove the filter for field TagType.  Tried several variants of this including creating a table variable but none worked.  So, need to do this: (1) table OneData_Tags should return all fields with current filters applied EXCEPT for field TagType - remove all filters on that field - so no filters on field TagType.  (2) Apply filter TagType = 'Business Owner' (3) Return concatenated string of all TagNames.
Appreciate your help with this!  Dan

Tried this but didn't work.  Error was: A table of multiple values was supplied where a single value was expected

 

TagName_BusinessOwner_Grouped = 
var tempTable = FILTER(OneData_Tags, ALL(OneData_Tags[TagType]))
return CONCATENATEX(FILTER(tempTable, OneData_Tags[TagType]="Business Owner"),OneData_Tags[TagName],", ")

 

 

 

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.