The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have created a list of states and added them to a slicer. Then, I added a new measure that concatenates the selected values in the slicer using comma as a delimiter. I want to use this measure in a SQL query written in Power Query. Below are the screenshots.
I want to use the Custom measure value in the below code:
let
Source = Sql.Database("localhost", "Dixan", [Query = "SELECT TOP (1000) [Location], [Name], [State] FROM [Dixan].[dbo].[PowerBi] where [State] in ('Delhi','Kerala')"])
in
Source
instead of 'Delhi','Kerala' I want to use measure value. Is this possible?
Solved! Go to Solution.
@dixanthomass No. To the best of my knowledge the only way you can use semantic model things in Power Query is using DirectQuery where you map columns to parameters: Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
@dixanthomass No. To the best of my knowledge the only way you can use semantic model things in Power Query is using DirectQuery where you map columns to parameters: Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Thank you, @Greg_Deckler for your response.
is this possible in any other way? i want to pass the selected values from the slicer into the SQL query for an IN operation. as mentioned in the above code.