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
marcio_fornari
Resolver I
Resolver I

Return all associated ID to use at IN Filter

Hi,

I have a table "D_CLINICAS" that one ID has many tenant_id associated.

1.png

I need use this values like IN expression values at RLS FILTER. (tenant_id IN {4,1511,5820,7891}

My dax return this values

2.png

 Expression on RLS

5.png

 

 

 When i test this Role, Broken the visuals and says: 

"Can not convert the values '7891,4,1511,5820' of type text to number type"

4.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@marcio_fornari , Create a table in var and use that in IN

 

example

measure =
var _tab = summarize(filter(Table,{empresa_id]=4),[tenant_id])
return
calculate(sum(Table[Value]), filter(Table,Table[tenant_id] in _tab))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@marcio_fornari , Create a table in var and use that in IN

 

example

measure =
var _tab = summarize(filter(Table,{empresa_id]=4),[tenant_id])
return
calculate(sum(Table[Value]), filter(Table,Table[tenant_id] in _tab))

@amitchandak Works like a charm!!! 

Thank you so much guy!good.png

 

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