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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Use Measure in Mquery

Hi,

 

I would like to add measure in Mquery. If there is any specific function that i need to use.

Problem Statement-

I am using data from two views. View  1 does a complex calculation using the parameter value passed to it.

View 2 contains columns that i want to use as slicer.The user should be able to select a value from slicer and this value should pass to View 1.I used Selected Value function in DAX to capture selected value from slicer in a Measure.

Now i want this measure in Mquery so that i can pass this value to View 1.

 

Any suggestions?

 

Regards

PowerBIUser

1 ACCEPTED SOLUTION

Hi Powerbiuser206,

 

If you want to achieve single selection, you can use DAX function selectedvalue(), it you want to achieve multiple selections, you can use DAX function allselected(). M query doesn't support interact with slicer because M query is a data shape language while DAX is a report level language.

 

Regards,

Jimmy Tao

View solution in original post

4 REPLIES 4
hs_sydney
Regular Visitor

Did you ever get an answer to this? I have a similar problem.  I would like to select dates in PowerBI slicer to retrieve data via an API call in M Query.  The API call requires a start date and end date (in Unix time) which I can do in PowerBI but I cannot pass these values back to Power Query to parameterize the API call.

Greg_Deckler
Community Champion
Community Champion

Your problem explanation does not make a lot of sense. You cannot use DAX measures in the query editor (M). Two different languages with two very different reasons for existing. 

 

Take a look at my article here:

https://community.powerbi.com/t5/Community-Blog/The-Languages-of-Power-BI/ba-p/69104

 



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...
Anonymous
Not applicable

Hi Greg,

 

Thankyou for your quick repsonse.

Let me re phrase my question.

Is there a way to pass values from slicers to Parameters in Power BI.

 

Regards

PowerBIUser

Hi Powerbiuser206,

 

If you want to achieve single selection, you can use DAX function selectedvalue(), it you want to achieve multiple selections, you can use DAX function allselected(). M query doesn't support interact with slicer because M query is a data shape language while DAX is a report level language.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.