Forum Discussion

markduffill's avatar
markduffill
Advocate I
9 years ago

Create a query/report in Visual Studio

Is it possible to create a Power BI desktop report/query using M and/or DAX from within Visual Studio?

 

I collect data to define the query from an ASP.NET application, so I can create a view in SSMS, but I want to also create a Power BI report based on this view and add measures, all within ASP.NET. Is this possible?

5 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    markduffill

     

    I think you're requiring some feature like programmatically create a pbix file in code, right? So far it is not implemented yet, you can vote up this idea Power BI Designer API

    Now you can only create the report in Power BI desktop, connecting to the view. May I know why you need to create the report pbix programmatically? As the reports can be fixed in many business, you just need to update the datasource.

    • markduffill's avatar
      markduffill
      Advocate I

      Thanks for your reply, and yes that is what I want to be able to do, to create a pbix programmatically.

       

      At the momment I create a view programattically and use this as a data source for reports. However, each view created for a customer (and there could be 100's) needs a few measures created as well as getting the data into the report. 

       

      It would be excellent if the pbix could be created programmatically including the measures, so the user does not need to be concerned with using DAX. 

       

      That's my aim. Seems like other products can do this, so Power BI should open up an API also. I've added my votes.

      • Eric_Zhang's avatar
        Eric_Zhang
        Microsoft Employee

        markduffill wrote:

        Thanks for your reply, and yes that is what I want to be able to do, to create a pbix programmatically.

         

        At the momment I create a view programattically and use this as a data source for reports. However, each view created for a customer (and there could be 100's) needs a few measures created as well as getting the data into the report. 

         

        It would be excellent if the pbix could be created programmatically including the measures, so the user does not need to be concerned with using DAX. 

         

        That's my aim. Seems like other products can do this, so Power BI should open up an API also. I've added my votes.


        Maybe one view for all customers and the customers can see their own data? Power BI does have a Row Level Security feature.