Page Break Expressions in Power BI - powerbi

I'm using the Power BI Report Builder.
Is there a way to insert a page break using an expression?
I need to be able to force a page break based on a value in a dataset field.
Is this possible?
All I'm finding is the ability to check a box to indicate a page break before or after a group.

Related

Work with Power BI Matrix taking data from DAX statement

I have the following requirements:
The user will see a Power BI Matrix on a web page (as opposed to Power BI Desktop).
The web page should have three elements: a text field, a button and the Power BI Matrix (potentially included in a Power BI Report).
The user will enter the DAX statement in the text field and click on the button to direct the Matrix to take the DAX statement, execute it, and populate the data.
The user should be able to drill down in the Matrix.
The user may reenter a new DAX statement, refreshing the Matrix.
Now, all the documentation I could find, for example here, talk about the Matrix in Power BI Desktop (i.e. not web page) and the data taken by selecting manually tables/columns/measures (on the right side of the screen).
In Power BI Studio, I know that I can enter a DAX statement by creating a table in the top bar, for example if I have the DAX:
EVALUATE TOPN (3, branches)
I could create a table to populate the Matrix with:
BranchesTable = TOPN (3, branches)
But how to dynamically link a DAX statment defined at run-time to a Matrix on a web page?
This is not currently possible to do exactly what you want. You can dynamically change a data source and update the query used in a specific report but there isn't an API available (PowerBI REST or PowerBI JavaScript) to update what columns are on a visual in a report. You can get pretty close to what you want but the report cannot be displayed in View mode and it will have to be displayed in Edit mode so the user will have the ability to drag the fields generated from their updated DAX query results onto the Matrix visual manually if they submit a change.
Assuming you already have the pre-requisite App Registration setup and configuration completed and your ready to embed here are some steps to get close to what your looking for. If your not ready to embed there is some documentation below the 8 steps I provided to complete the pre-requisite setup to be able to embed.
Using PowerBI Desktop Create a template report that has a matrix visual and a connection to the data source you want to use. Be sure to set this report up using a specific query and NOT all tables in the data source whether its SQL or SSAS. (You specify the query under advanced options when you initially setup the data source in the report)
Setup a Power BI Data Gateway to the Data Source your report uses
Create a workspace on PowerBI.com to upload the report to
Using PowerBI desktop Publish the report you created in step 1 to the workspace you created in step 3
On your Web Application, when a user views the report viewer page, you need a way to identify each user. Lets assume you have UserId field that is a unique ID for each user. Call GetReports in group https://learn.microsoft.com/en-us/rest/api/power-bi/reports/getreportsingroup. You need to have a known report name plus the UserId. Lets assume its DynamicReport. So call GetReports and check if DynamicReport_UserId exists for the user trying to view the report viewer page in your web application.
In that API calls result from step 5, if the report does not exist for a user, use https://learn.microsoft.com/en-us/rest/api/power-bi/reports/clonereport to clone the template report you published in step 4.
Embed and display user specific template report (DynamicReport_UserId) for the user.
Have logic on the report viewer page so the user can submit and POST a DAX query. When they do a submit have logic to use https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources on the back end to update the data source in their report and then embed the report again with their DAX statement and changed data.
The visual isn't going to automatically update to the new fields from the new query that is submitted by the user but the available data fields they have in editor mode will change. The user will have to drag and drop the fields from their DAX query onto the Matrix visual or whatever visual type they are going to chose to use. You won't be able to just display a report in View mode since you don't have a way to programatically update what fields are on visual. The user may even end up seeing a broken visual initially because of the changed query and the visual referencing fields from the previously used query. You could use PowerBI Javascript API to hide the existing visual to improve the user experience of the user not seeing something broken.
Let me know if you have any specific questions about these API calls or how to use them.
Here is where I've been looking for the Power BI JavaScript functionality https://github.com/Microsoft/powerbi-javascript/wiki (Can't find anything specific to matrix Visuals. The JavaScript functionality for visuals generic to Visuals and not Visual Type like Matrix or Card)
Here is Microsoft's documentation on the available REST APIs and https://learn.microsoft.com/en-us/rest/api/power-bi/
Here are some good resources to learn more about embedding
https://learn.microsoft.com/en-us/power-bi/developer/embedded/register-app
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embedding
If you need drill down capability Hierarchies are a great option
https://spreadsheeto.com/power-bi-hierarchy/

How to remove page filter from a single visual taken from Embedded Power BI report

While trying to embed a single visual from an embedded Power BI report, the page filters applied to the report is also coming along the Visual and I am not able to remove it using removeFilter function mentioned in Power BI playground. I tried like :
Take the visual from report and tried removing filter to the single visual.
Remove the filter from report (successful) and get the Single Visual.
In both cases, Visuals are displayed with Filter.
Could anyone please help me out?
Dashboard are basically for presentation purpose. First you will generate your desired output for a visual in the report using - Slicing, Filtering and drilling down. Once your visual is showing your expected output, you can then PIN your visual to your target dashboard. Remember, once you pinned a visual to a dashboard, you can not change it any more in the dashboard. If you need changes, you need to perform in in the report and then again pin your final output to the dashboard.
Lets go through some comment/explanation from different blogs and tutorials-
Tiles/visuals pinned to a dashboard are displayed based on the filters applied
to them via the filter pane OR via slicers OR via cross filtering at
the time of pinning in report.
Dashboards do not currently have filters that will allow filtering
across tiles/visuals.
A dashboard can contain charts from multiple reports. That’s why a
sliver doesn't make sense on a dashboard, because the slicer can't
filter all charts/datasets.
Whatever, I also found some comments as below, but I have not enough knowledge about the approach mentioned.
If you would like the ability to filter specific tiles on a dashboard,
pin live report pages
You can pin a whole report page as a live page, so that any changes
you make in that report page will be reflected in the live page you
pinned to your dashboard.
You can do some google about what is power bi Live Report is

How to match a e-mail from a table with dax function USERPRINCIPALNAME and let the user visualize the report in PowerBI?

I need to hide a page from a group of users, but I've read that there is no RLS-like service to do that. I found a "tip" to use a card and paint it white or transparent to hide the page contents. It would work fine for me, but here is my problem:
I have a table with page name and the e-mail of the users allowed to access its contents. I need to query that table, returning the page name when the e-mail equals to USERPRINCIPALNAME (DAX function), but I haven't found how to link these information.
I tried to create a column named "allowed", comparing the e-mail value with this DAX function, but PowerBI does not allow its use (it can only be used with Measures). Then, I tried to create a measure comparing both values, but I cannot access the table value (it's not displayed in the list of available options).
What can I do? Any clues?
Regards
There is in fact RLS feature with Power BI that can be used to restrict data access for given users.
Refer: https://learn.microsoft.com/en-us/power-bi/service-admin-rls

Web query with Power BI desktop returns empty table

I'm trying to import data from a web page to Power BI Desktop. The URL is the following:
https://casa.sapo.pt/Venda/Apartamentos/Maia/?sa=13
It contains data about housing prices, characteristics, etc.
The query returns an empty table, although if I browse to the page with any browser and without authentication or login, I see it contains the data I'm looking to analyse so I guess the publisher has disabled somehow the query I'm trying to make.
Does anyone know a workaround?
Power BI / Power Query gives quite disappointing results against that fairly typical page structure. It only seems to work well against "Web 1.0" style HTML tables. There are so few of those around (outside of Wikipedia) that it is almost pointless ...
You could try Chris Webb's ExpandAll function (link below) that will expand out all the data available.
http://blog.crossjoin.co.uk/2014/05/21/expanding-all-columns-in-a-table-in-power-query/
Then you can exclude all the non ".Text" columns and merge them together to get all the text from the page in one column - but it's hard to make sense of it. You also lose a lot of the HTML content eg links, image URLs.

Oracle Apex 5: retain format of Interactive Report on download

In Oracle Apex 5, a user can manipulate an Interactive Report's data with a number of actions (Sort, Filter, Group By, Control Break...). However, when the report is downloaded as a CSV only the Filter action is retained from the manipulations. How can you get the download of an Interactive Report to display the report as is?
The closest solution I could find is a plugin found on github, see Interactive Report to Excel v2
At the time, it worked for the particular report we had an issue with (Control Break on one column, with some Sorting), but when I tried it on a Group By it didn't work.
We have had good results with APEX_IR_XLSX and have added our own customization pieces to it quite easily.