Search code examples
powerbidaxpowerquerym

M Power Query refer to DAX calculated table as a source


Is it possible to refer from Power Query (M) to DAX calculated table? I would like to get DAX table as a source to my power query.

The purpose. I have grouping table made in DAX. I would like to make econometric model with R. So I would like to transform the DAX table with R to get the model parameters. I would like to use these parameters further in DAX measures (not just display them).

Currently I dump the DAX grouping table to Excel file and then pull it up with Power Query.


Solution

  • Actually, there is a way.

    DISCLAIMER: This is a hack. You should not rely on this way.

    1. Create DAX calculated table

    Input any DAX formula that evaluates to a table in Modeling > New Table.

    DAX Calculated Table

    2. Check port number using DAX Studio

    Connect to your PBI Desktop data model using DAX Studio, and check the port number where the data model is hosted. It should be displayed in the right bottom of the window.

    DAX Studio

    3. Import the table to Power Query

    Click Get Data > Analysis Services and input the address (in my example "localhost:50293") to Server. Then navigate to your DAX calculated table.

    Power Query