Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)
edited by

How can I connect Power Bi from VBA to export lot of data more than the limit

I am using the following Power Bi Script

Can VBA export a lot of data?

# Connect using ADOMD.NET (power shell script)

  [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices.AdomdClient") 
    #[Microsoft.AnalysisServices.AdomdClient.AdomdConnection]  

    # Create the first connection object  
    $con = new-object Microsoft.AnalysisServices.AdomdClient.AdomdConnection 
    $con.ConnectionString = "Datasource=$dataSource; Initial Catalog=$Database_Name;timeout=0; connect timeout =0" 
    $con.Open() 

    "Datasource= " +$dataSource
    "Database_Name= " +$Database_Name

    $filename = "Table1.csv"


    # Create a command and send a query 
    $command = $con.CreateCommand()
    $command.CommandText = $query


    $adapter = New-Object -TypeName Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter $command
    $dataset = New-Object -TypeName System.Data.DataSet
    $adapter.Fill($dataset)

    $dataset.Tables[0] | export-csv $filename -notypeinformation


1 Answer

0 votes
by (22.5k points)
edited by

You can define three tables and then write the VBA code:

VBA_Part1

VBA_Part2

Check the link for further reference.

For more information on Power BI, check the following Power BI Course!

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jan 24, 2021 in BI by Chris (11.1k points)
0 votes
1 answer
asked Dec 13, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...