Forum Discussion

PBI_DAX_Newbie's avatar
PBI_DAX_Newbie
New Member
2 years ago
Solved

How to create a proper Multi-(IN) Clause DAX Query

Hello,

 

My Scenario

I am trying to implement Dynamic RLS in Power BI and I am trying to add filters into my DAX and failing miserably. I am clearly writing it incorrectly and I also receive an error which I will describe below. And I get the model may be bleh but its what I have to work with.

 

Image I have the following ugly Schema and I want to pull out all the Invoices that are for a specific User. I would think of it like this in SQL Terms

 

Select * from Invoices where City in (Select City from Cities where State in (Select State from States where Region in (Select Region from Regions where Region in (Select Region from UserfTORegionMapping where EmailAddress = USERPRINCIPLENAME())))

(of course it would simply using = than ins above but its just one way to look at it)

 

But I am having no idea how to do this in DAX. I tried playing around with FILTER and IN but going passed a single = or IN and I immediatley and lost.

 

Thank you Kindly for looking at this and helping

 

1 Reply