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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Heinrich
Post Patron
Post Patron

Copy all data from direct query table

Hello

I have access to CQD (Microsoft Teams Table - Direct Query).
I would like to copy static data to a local table. Either some columns or all the data.
Do you have a Script or way to accomplish that.

Thank you very much
JFM_12

10 REPLIES 10
Heinrich
Post Patron
Post Patron

Hello Saudansari
Thank you.
I do not know which datatype Microsoft is using for these columns in Direct Query.


The database is in Direct Query and has to be connected using SQL if I understand you right.

Is there another way to do that.  CQD is run by Microsoft, Power BI Template of CQD is freely available.

Need to merger local information with CQD. Is there another way to do that?


Thank you 

JFM_12

Here's a general approach you might take within Power BI:

  1. Power Query in Power BI Desktop:

    • Open your Power BI Desktop file.
    • Go to the "Home" tab, click on "Get Data," and select your data source (Microsoft Teams in this case).
    • Use Power Query Editor to transform and clean your data.
    • Load the data into Power BI.
  2. Data Model in Power BI:

    • Once the data is loaded, create relationships and build your data model in Power BI Desktop.
    • You can combine data from different tables or sources using relationships.
  3. Local Data:

    • If you have local data that you want to merge with the data from Microsoft Teams, you can import that data into Power BI as well.
    • Create relationships between the tables in the data model.
  4. Power BI Report:

    • Build your Power BI report using the combined data from Microsoft Teams and your local source.
  5. Refresh Data:

    • Schedule data refresh in Power BI Service so that your report gets updated with the latest data from Microsoft Teams.

Hello Saudansari
Thank you very much

But I can not transform the data because it is Direct Query where data is stored.
The columns are not visible only accessible that is why I need to copy all the data locally
to do some manipulation. Only then I can transform the data and apply other format or more.
Best case would be to copy only neded columns worst case to copy all the data locally.
Do you have any other solutions
Thank you
JFM_12

you can consider the following options:

  1. Power BI Dataflows:

    • Use Power BI Dataflows to transform and reshape the data.
    • Create a dataflow that pulls data from your Direct Query source, performs the necessary transformations, and stores the result in Power BI Dataflows.
    • Once the dataflow is set up, you can use it as a source for your Power BI report.
  2. Power Query and Local Tables:

    • Import the entire dataset into Power BI (even if it's large).
    • Use Power Query within Power BI to filter and transform the data as needed.
    • Create relationships between tables and build your report.

      Other than this I am not sure how I can help further on this. 

Hello
Thank you Dataflow is done using the Power BI Service, right?
But Dataflows has to be subscribed and paid. It is not enabled in our Company.

Is there a way to do that with DAX?
Get a Query with DAX and import this to a local table?

Regards
JFM_12

Yes, dataflow is with Power BI service. You will have to write the query in whatever database you have and then pull that from the get data in the Power BI desktop. 

saudansari_0-1703262254915.png

Or you can download he file from Power BI service and go to model view and change the storage mode to import in that way it will store the data locally

Hello Saudansari

Dataflow is not enabled in our company
The Power BI File is allready available at Microsoft Site and allready opened. 
Change the Storage Mode and how do I have to import it?

I am looking for a solution in DAX is this possible?
Is it possible to have a DAX query that pulls the data and copies it to a local table?
Regards
JFM_12

I am unsure if this will work but you can create a calculated table in DAX

LocalTable =
SUMMARIZE(
'TeamsTable',
'TeamsTable'[Column1],
'TeamsTable'[Column2],
-- Add other columns as needed
)

if this works please accept it as solution

Hello Saudansari
Hope you are doing well
Thank you very much for your support
1. Dataflow has to be licensed right. Then this is not enabled

2. Your solution

LocalTable =
SUMMARIZE(
'TeamsTable',
'TeamsTable'[Column1],
'TeamsTable'[Column2],
-- Add other columns as needed
)

-> Create local table and and this as DAX where

- TeamsTable is name of original Table, right?
- TeamsTable[Column1] etc. name of original column

I did it as you said

Copy_CQD = SUMMARIZE(
'CQD',
'CQD'[Second UPN],
'CQD'[Second Client App Version]
)
It worked but when I added 'CQD'[Second Client App Version] it timed out.
Have you an idea how to fultill the task?

Regards

JFM_12

saudansari
Helper II
Helper II



Using SQL to copy data from one table to another. Replace the table and column names with the appropriate ones from your Microsoft Teams table:
-- Create a new local table (if it doesn't exist)
CREATE TABLE LocalTable (
Column1 datatype,
Column2 datatype,
-- Add other columns as needed
);

-- Insert data into the local table from the Teams table
INSERT INTO LocalTable (Column1, Column2, ...)
SELECT Column1, Column2, ...
FROM TeamsTable;

Make sure to replace LocalTable, Column1, Column2, etc., and TeamsTable with the actual names used in your scenario. Also, ensure that the datatypes match between the source and destination columns.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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