Exporting data from the Excel data model into an Excel table or as CVS file to be used in SQL Server

%3CLINGO-SUB%20id%3D%22lingo-sub-1612167%22%20slang%3D%22en-US%22%3EExporting%20data%20from%20the%20Excel%20data%20model%20into%20an%20Excel%20table%20or%20as%20CVS%20file%20to%20be%20used%20in%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1612167%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3A%20I%20have%20not%20been%20able%20to%20find%20a%20way%20to%20export%20an%20existing%20large%20table%20currently%20in%20the%20Excel%20data%20model%20(power%20pivot)%20either%20to%20an%20Excel%20table%2C%20or%20as%20a%20.csv%20file%2C%20or%20some%20other%20way%20to%20get%20it%20into%20SQL%20server.%20Any%20advice%3F%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1612167%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1612500%22%20slang%3D%22en-US%22%3ERe%3A%20Exporting%20data%20from%20the%20Excel%20data%20model%20into%20an%20Excel%20table%20or%20as%20CVS%20file%20to%20be%20used%20in%20SQL%20Se%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1612500%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F771099%22%20target%3D%22_blank%22%3E%40cbsoria%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.edureka.co%2Fcommunity%2F28113%2Fhow-export-power-queries-from-one-workbook-another-with-vba%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.edureka.co%2Fcommunity%2F28113%2Fhow-export-power-queries-from-one-workbook-another-with-vba%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1613038%22%20slang%3D%22en-US%22%3ERe%3A%20Exporting%20data%20from%20the%20Excel%20data%20model%20into%20an%20Excel%20table%20or%20as%20CVS%20file%20to%20be%20used%20in%20SQL%20Se%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1613038%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F771099%22%20target%3D%22_blank%22%3E%40cbsoria%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20not%20sure%20how%20to%20import%20into%20SQL%20server%2C%20but%20in%20any%20case%20you%20shall%20to%20load%20first%20the%20data%20model%20table%20into%20Excel%20sheet.%20Here%20it%20depends%20on%20how%20it%20was%20loaded%20to%20data%20model.%3C%2FP%3E%0A%3CP%3EIf%20by%20Power%20Query%2C%20right%20click%20on%20query%20name%20in%20right%20pane%20and%20Load%20to%20table.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20it%20was%20loaded%20by%20Power%20Pivot%20connector%2C%20you%20may%20use%20data%20connections.%20First%20create%20any%20dummy%20table%20in%20Excel%20sheet%20like%20this%20one%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%2097px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214774i0484AD56E0A0F84F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAfter%20that%20Data-%26gt%3BExisting%20connections%2C%20select%20this%20dummy%20table%20and%20load%20it%20as%20table%20into%20the%20sheet.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20403px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214775i99C1FCA8155D8099%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ERight%20click%20on%20it%20and%20select%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20622px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214776iA991D1DAED431CFB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHere%20keep%20command%20type%20Table%20and%20type%20the%20name%20of%20the%20table%20in%20data%20model%20if%20you'd%20like%20to%20download%20it%20as%20it%20is.%20Otherwise%20select%20DAX%20from%20drop-down%20menu%20and%20use%20DAX%20query%20expression%20to%20return%20transformed%20table%20starting%20from%20EVALUATE.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20296px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214777iE72E05F87ED6811E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAs%20result%20data%20model%20table%20will%20be%20loaded%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20279px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214778iD8C66FA5ED2365C5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello: I have not been able to find a way to export an existing large table currently in the Excel data model (power pivot) either to an Excel table, or as a .csv file, or some other way to get it into SQL server. Any advice? Thank you!

2 Replies
Highlighted

@cbsoria 

I'm not sure how to import into SQL server, but in any case you shall to load first the data model table into Excel sheet. Here it depends on how it was loaded to data model.

If by Power Query, right click on query name in right pane and Load to table.

 

If it was loaded by Power Pivot connector, you may use data connections. First create any dummy table in Excel sheet like this one

image.png

After that Data->Existing connections, select this dummy table and load it as table into the sheet.

image.png

Right click on it and select

image.png

Here keep command type Table and type the name of the table in data model if you'd like to download it as it is. Otherwise select DAX from drop-down menu and use DAX query expression to return transformed table starting from EVALUATE.

image.png

As result data model table will be loaded

image.png