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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors