The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
I want to move all measures in my Measure table into OneLake model from Import Mode report.
how to do this without using Semantic Labs?
Best,
Jacek
Solved! Go to Solution.
Hi @jaryszek ,
Yes, you can absolutely move an entire measure table from a Power BI Import Mode report to a OneLake model without Semantic Link. The most common methods involve using external tools or the DAX Query View feature within Power BI Desktop.
One of the most efficient ways is by using Tabular Editor. You would start by opening two instances of Tabular Editor. Connect the first instance to your local Power BI Desktop file and the second instance to your Direct Lake semantic model using its XMLA endpoint. In the instance connected to your local file, navigate to your measure table, select all the measures you wish to move, and copy them. Then, switch to the instance connected to your Direct Lake model, select the destination table, and simply paste the measures. After pasting, save the changes back to the Power BI service to finalize the process.
Alternatively, you can use the DAX Query View directly within Power BI Desktop. First, open the Import Mode report that contains your measures. Switch to the DAX Query View, find your measure table in the Data pane, right-click it, and select "Define all measures in this table." This action will generate a DAX script containing the definitions for all the measures in that table.
DEFINE
TABLE 'YourMeasureTableName' =
ADDCOLUMNS(
KEEPFILTERS(
FILTER(
VALUES('YourMeasureTableName'[Measure]),
NOT(ISBLANK('YourMeasureTableName'[Measure]))
)
),
"Expression",
VAR vMeasure = 'YourMeasureTableName'[Measure]
RETURN
SWITCH(
vMeasure,
"Total Sales", [Total Sales],
"Sales YTD", [Sales YTD],
"Profit Margin", [Profit Margin]
// ... and so on for all your measures
)
)
EVALUATE
'YourMeasureTableName'
Copy this entire generated script. Next, open a new Power BI Desktop file and create a live connection to your Direct Lake semantic model. Go to the DAX Query View in this new file, paste the script you copied, and run it. This will create all the measures in your Direct Lake model. Remember to save and publish the file to apply the changes in the service.
For a more automated, code-driven solution, you can use PowerShell. This advanced method involves saving your .pbix file as a .pbit template, renaming it to a .zip file, and extracting its contents. Inside, you'll find the DataModelSchema JSON file, which contains all the model metadata. You can write a PowerShell script to parse this JSON file to extract the measure names and their DAX expressions. Finally, using the Tabular Object Model (TOM) library in PowerShell, you can connect to your Direct Lake model and programmatically create each of the extracted measures.
Best regards,
Hi @jaryszek ,
Thank you for reaching out to the Microsoft fabric community forum. thank you @DataNinja777 for your helpful response.
Thank you for confirming the steps you’ve taken and providing the error message. The “Cannot find table <oii>MeasureTable</oii>” error occurs because your Direct Lake semantic model doesn’t yet have a dedicated Measure Table. To proceed with moving or pasting your measures, please create this table within your Lakehouse model first.
You can do this directly in Power BI Desktop by following these steps:
MeasureTable = DATATABLE("Placeholder", STRING, { { "" } })
This creates a single-column dummy table that acts as a container.
Once done, your Direct Lake model will contain the same measure structure as your Import Mode report, and you’ll be able to proceed with the migration smoothly.
Hope this helps, please feel free to reach out for any further questions.
Thank you.
Hi @jaryszek ,
Yes, you can absolutely move an entire measure table from a Power BI Import Mode report to a OneLake model without Semantic Link. The most common methods involve using external tools or the DAX Query View feature within Power BI Desktop.
One of the most efficient ways is by using Tabular Editor. You would start by opening two instances of Tabular Editor. Connect the first instance to your local Power BI Desktop file and the second instance to your Direct Lake semantic model using its XMLA endpoint. In the instance connected to your local file, navigate to your measure table, select all the measures you wish to move, and copy them. Then, switch to the instance connected to your Direct Lake model, select the destination table, and simply paste the measures. After pasting, save the changes back to the Power BI service to finalize the process.
Alternatively, you can use the DAX Query View directly within Power BI Desktop. First, open the Import Mode report that contains your measures. Switch to the DAX Query View, find your measure table in the Data pane, right-click it, and select "Define all measures in this table." This action will generate a DAX script containing the definitions for all the measures in that table.
DEFINE
TABLE 'YourMeasureTableName' =
ADDCOLUMNS(
KEEPFILTERS(
FILTER(
VALUES('YourMeasureTableName'[Measure]),
NOT(ISBLANK('YourMeasureTableName'[Measure]))
)
),
"Expression",
VAR vMeasure = 'YourMeasureTableName'[Measure]
RETURN
SWITCH(
vMeasure,
"Total Sales", [Total Sales],
"Sales YTD", [Sales YTD],
"Profit Margin", [Profit Margin]
// ... and so on for all your measures
)
)
EVALUATE
'YourMeasureTableName'
Copy this entire generated script. Next, open a new Power BI Desktop file and create a live connection to your Direct Lake semantic model. Go to the DAX Query View in this new file, paste the script you copied, and run it. This will create all the measures in your Direct Lake model. Remember to save and publish the file to apply the changes in the service.
For a more automated, code-driven solution, you can use PowerShell. This advanced method involves saving your .pbix file as a .pbit template, renaming it to a .zip file, and extracting its contents. Inside, you'll find the DataModelSchema JSON file, which contains all the model metadata. You can write a PowerShell script to parse this JSON file to extract the measure names and their DAX expressions. Finally, using the Tabular Object Model (TOM) library in PowerShell, you can connect to your Direct Lake model and programmatically create each of the extracted measures.
Best regards,
thank you.
The best way to be move Measure Table using DAX queries.
I reproduced the steps.
The issue is that while i am copying my dax measures i am getting error:
How to create a Measure Table in my LakeHouse model?
Best,
Jacek