Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

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

  • 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

4 Replies

  • hs_sydney's avatar
    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.

    • Anonymous's avatar
      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

      • v-yuta-msft's avatar
        v-yuta-msft
        Community Support

        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