Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
dixanthomass
Regular Visitor

Use New Measure Value in Power Query

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.

 

Screenshot 2024-07-03 220224.png

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?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors