Forum Discussion

rsmhema1993's avatar
rsmhema1993
Frequent Visitor
9 years ago
Solved

Is it Possible to add some more column into an existing visual after the dashboard published to app

Hi Everyone,   I integrated my dashboard into an app using Power BI Embedded method. My doubt is, Can i able to add some more fields to the existing visual after integrating into an app? May...
  • Eric_Zhang's avatar
    9 years ago

    rsmhema1993

    You can edit the reports in Power BI Embedded. Just check below demo, copy and paste the code in a .html file and run it in Chrome. See more demos here.

     

    <html>
    
     <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>
    
    <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>
     
    <script type="text/javascript">
    window.onload = function () {  
     
    // Read embed application token from textbox
    var txtAccessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXIiOiIwLjIuMCIsIndjbiI6IlBvd2VyQmlBenVyZVNhbXBsZXMiLCJ3aWQiOiJmODFjMTk2Ni1lZGVlLTQxMWItOGY4YS1mODQ0NjAxOWIwNDQiLCJyaWQiOiJjNTJhZjhhYi0wNDY4LTQxNjUtOTJhZi1kYzM5ODU4ZDY2YWQiLCJpc3MiOiJQb3dlckJJU0RLIiwiYXVkIjoiaHR0cHM6Ly9hbmFseXNpcy53aW5kb3dzLm5ldC9wb3dlcmJpL2FwaSIsImV4cCI6MTg5MzQ0ODgwMCwibmJmIjoxNDgxMDM3MTY5fQ.m4SwqmRWA9rJgfl72lEQ_G-Ijpw9Up5YwmBOfXi00YU';
     
    // Read embed URL from textbox
    var txtEmbedUrl = 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=c52af8ab-0468-4165-92af-dc39858d66ad';
     
    // Read report Id from textbox
    var txtEmbedReportId = 'c52af8ab-0468-4165-92af-dc39858d66ad';
     
    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;
     
    // Embed configuration used to describe the what and how to embed.
    // This object is used when calling powerbi.embed.
    // This also includes settings and options such as filters.
    // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
    var config= {
        type: 'report',
        accessToken: txtAccessToken,
        embedUrl: txtEmbedUrl,
        id: txtEmbedReportId,
        permissions: models.Permissions.All /*gives maximum permissions*/,
        viewMode: models.ViewMode.Edit,
        settings: {
            filterPaneEnabled: true,
            navContentPaneEnabled: true
        }
    };
     
    // Get a reference to the embedded report HTML element
    var reportContainer = $('#reportContainer')[0];
     
    // Embed the report and display it within the div container.
    var report = powerbi.embed(reportContainer, config);
     
    // Report.off removes a given event handler if it exists.
    report.off("loaded");
     
    // Report.on will add an event handler which prints to Log window.
    report.on("loaded", function() {
        Log.logText("Loaded");
    });
     
    report.off("error");
    report.on("error", function(event) {
        Log.log(event.detail);
    });
     
    report.off("saved");
    report.on("saved", function(event) {
        Log.log(event.detail);
        if(event.detail.saveAs) {
          Log.logText('In order to interact with the new report, create a new token and load the new report');
        }
    });
     
    }
    </script>
    
    <div id="reportContainer" ></div>
    
    </html>