Power BI Embed URL-multiple filters - filter

I have been trying to filter my embedded PBI report using the filter query syntax:
&$filter={tableName/fieldName} eq '{fieldValue}'
and this works for me.
However, when I apply more than one filter, the PBI report is filtered only according to the last $filter and other filters are disregarded.
Is there a way to add multiple filters in the Power BI embed URL?

With the release of 2.0.0 you can now get and set filters at report scope and page scope. We currently don't support visual scope but it is planned to come in the future.
See: https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters
for more information on how to use the SDK to apply filters.
You can also set filters during load.
https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details
You can see a working demo of using filters here:
https://microsoft.github.io/PowerBI-JavaScript/demo/filters.html
If the filters you are applying need to be secure (they can't be modified by the client) then you must use RLS on the report, and then add the username and/or role claims to your JWT token. Then requests to view the report with this token will only show data for allowed user or role.
The OData $filter parameter only supports a subset of filter capabilities. If you want to have more complex values or conditions it is recommended to use the SDK to construct filter objects.

Related

Customize Data Studio reports with different filters for different users

I have many end users for my reports. Some of them want to look at all website data, some just section A, some section B, etc. For my own sanity and not having to create the same report over and over with different filters, I'm wondering if there's either:
A way to provide a link to a report where the link tells data studio what filter to apply to the report
A way to filter the report based on the user who's logging in.
I have the impression that neither of these is possible, and it seems like people are reluctant to have one dashboard that they have to proactively filter for their section (I'm still going to try that). But I'm hoping that there's perhaps something I didn't know about.
This is possible using Custom bookmark links (doc). The Drill down table example (doc) shows how you can create a table with records linking to a second page of the dashboard with different filters. You could use this to create filter pre-sets for different users groups.
This is currently not possible.

How to get filtered statistics in admin-on-rest

After I had great pleasure with the simple implementation of filters in the admin-on-rest List View, I would now like to have a similar view, which does not show the individual posts in a table or as cards but aggregated statistics related to the filter.
For example: Filter all users by male gender. The statistics should then be based on the men, e. g. a histogram with an age distribution.
Is it possible to modify a Custom Iterator in this way? If not, how can I achieve my goal? Can someone give me a jump-start?
You could indeed use a Custom Iterator, however you'll only receive a page of resources which may not be ideal to generate statistics.
If you want statistics on all the data targeted by the filters, you have two options:
declare a new resource for statistics allowing the same filters and generate the statistic on server side. Then, use a Custom Iterator to display them nicely
create a custom route for statistics and do what you would do in a classic React app without using aor

Microstrategy - filtering a dashboard depending on the user

I need to filter a dashboard basing on the user.
for example:
if user1 my-attribute = 1
if user2 my-attribute = 2
What method could I use for doing it also in reports and documents?
What you need here are the MicroStrategy Security Filters.
You can create two security filters, let call them:
MyAttributeEqual1
and
MyAttributeEqual2
Security Filters are pretty much similar to normal filters, so you can play with them and figure out the best condition you want to use.
Then you have to modify the users to assign the right filter.
In case you need you can assign Security Filters to a User Group and it will be applied to all users in that group.
Security filters will be added to the SQL code generate by MicroStrategy when you run a report and they will become an additional where condition.
A word of warning, be careful if you assign a security filter to an attribute and then you show data for a parent attribute, in that case the SQL engine will not apply the filter.

Google Site Search API - Filtering using multiple attributes

Is it possible to filter Google custom search results using multiple pagemap attributes?
For example, I want to filter results using meta tags category_name and site_section. I have tried to do this in different ways including the following, but it doesn't work:
?q=search_term+more:p:metatags-category_name:filter_term,more:p:metatags-site_section:filter_term
I have looked at the Google developers documentation but it only shows filtering using one attribute with multiple keywords.

web api odata service - return complex type

i want to create web api odata service that return reault type which consist of collection data member and additional members like this service return:
http://services.odata.org/OData/OData.svc/Suppliers?$filter=Address/City eq 'Redmond'
as you can see the result type is consist of collection data member and additional members
can anyone send me a sample how to do it?
i can't succeed to create this kind of complex type and to be able filter the collection items by there values
as yuo can see in this query it return all the result without filter the items
services.odata.org/OData/OData.svc/Suppliers
i want to be able filter this type like this:
services.odata.org/OData/OData.svc/Suppliers?$filter=Address/City eq 'Redmond'
in this query i managed to filter the collection member items and still returning the other data members.
If you just want to implement filters like: services.odata.org/OData/OData.svc/Suppliers?$filter=Address/City eq 'Redmond'
Please check the sample at http://aspnet.codeplex.com/SourceControl/changeset/view/903afc4e11df#Samples%2fNet4%2fCS%2fWebApi%2fODataServiceSample%2fReadMe.txt
It has a supplier and address model with queryable attribute. It should work with the same $filter query.
Odata support was implicit in asp.net webapi RC.
You just had to return a IQueryable from you Actions and mark it with [QueryableAttribute].
Only this much supported querystring based data filtering.
I was a bit disappointed when I saw the [QueryableAttribute] doesnt build in RTM.
In RTM it’s available as a separate package, Microsoft.AspNet.WebApi.OData on Nuget in a preview/alpha form. Full release is coming later this fall. You can grab it from here(http://www.nuget.org/packages/Microsoft.AspNet.WebApi.OData). There is a nice overview post available (http://blogs.msdn.com/b/alexj/archive/2012/08/15/odata-support-in-asp-net-web-api.aspx)

Resources