cancel
Showing results for 
Search instead for 
Did you mean: 
darogael

Deep-dive in the Power BI Integration with PowerApps

Introduction
This blog walks you through how you can use PowerApps in Power BI to save a snapshot of data available in a Power BI Report. In addition, we will add the option to add a comment.
 
Key items covered:
 - Walk through an existing Power BI Report and the prep work it needs
 - Create the Common Data Service (CDS) entities
 - Create the PowerApps form using Power BI Integration
 - Add the CDS entities to the report
 
The video walks you through all the key items mentioned above. In addition here are the expressions/formulas incase you want to copy and paste. I've also provided important screenshots
 
The AddScreen OnStart. This is where you set the variable and the collections to temporarily store the data. The collections also provides you the correct column names to create the final expression.
 
Screenshot
 
Capture1.JPG

Expression:
Set(SubmitVar,false);
ClearCollect(TempCollection1,Defaults('Carolina Florence Data'));
ClearCollect(TempCollection2,Defaults('Carolina Florence Comments'))

The Submit button's OnSelect function. This is to submit the data to the common data entities
 
Screenshot
 
Capture2.JPG

Expression
 
Clear(TempCollection1);Clear(TempCollection2);
Set(DateNowVar,Now());
ForAll(
    PowerBIIntegration.Data,
    Collect(
        TempCollection1,
        {
            cr8a7_primaryid:Substitute(Substitute(Substitute(Text(Now()),"/","")," ",""),":",""),
            cr8a7_statelong:StateLong&"",
            cr8a7_stateshort:StateShort&"",
            cr8a7_county:County&"",
            cr8a7_city:City&"",
            cr8a7_homes:Homes,
            cr8a7_hospitals:Hospitals,
            cr8a7_schools:Schools,
            cr8a7_hotels:Hotels,
            cr8a7_highways:Highways,
            cr8a7_apartments:Apartments,
            cr8a7_gasstations:'Gas Stations'
        }
    )
);
    Collect(
        TempCollection2,
        {
            cr8a7_primaryid:Substitute(Substitute(Substitute(Text(Now()),"/","")," ",""),":",""),
            cr8a7_comment:Commenttxt.Text
        }
    );
    Collect('Carolina Florence Data Demos',TempCollection1);Collect('Carolina Florence Comments Demo',TempCollection2);
    Reset(Commenttxt);Set(SubmitVar,false)

Video
This is a step-by-step video which walks you through how to build the Power BI Integration
 

Conclusion
Now for the first time you can see how filtered data from a table visualization can be saved to a data source with a click of a button. If you wish, you can also add comments as described in this blog. Finally, now that you have seen how data from a particular time-stamp can be saved in a data source, you can take this data and build your own aging report.  

Links: