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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.