Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rsathish_red
Frequent Visitor

set default value to power bi filter dropdown.

Hi. I have filters in reports (See attached screehshot)Screen Shot 2018-08-28 at 10.22.57 AM.png

 

I need to set default value for the dropdown values so the end user will see the report for the selected values. Still they can see other values in the dropdown (like below screenshot). 

Screen Shot 2018-08-28 at 10.23.23 AM.png

I tried BasicFilter method. Filter is working but the dropdown displays only the option that i passed through the method.

I tried passing value 'Asian'Screen Shot 2018-08-28 at 11.01.42 AM.png

Is it possible to show all values in the filter dropdown and passed values should be selected by default?

 

 

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @rsathish_red,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @rsathish_red,

 

How did you pass the value "Asian"?

We can just make a selection in the slicer and SAVE the report then we can share the report with a default selection. Is this good enough?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I passed variable through the BasicFilter option. See below code

const basicFilter = {
        $schema: "http://powerbi.com/product/schema#basic",
        target: {
          table: "2009 sample V2",
          column: "Ethnicity"
        },
        operator: "In",
        values: ['Asian']
      }

 iframe.onload = function () {
        var msgJson = {
          "method": "POST",
          "url": "/report/load",
          "headers": {  ...  },
          "body": {
            "settings": {
              "filterPaneEnabled": false,
              "navContentPaneEnabled": false
            },
            "filters":[basicFilter],
            "type": "report",
            "tokenType": 1,
            "accessToken": txtAccessToken,
            "embedUrl": txtEmbedUrl,
            "id": txtEmbedReportId,
            "permissions": 7,
          }
        };
        iframe.contentWindow.postMessage(msgJson, "*");

We are using Angular js as frondend to show Reports. It will be dynamic so we need to pass the values while displaying report.

You mentioned about Slicer. Will it be possible to pass it through JS?

Hi @rsathish_red,

 

It's normal sharing in my previous post. Seems you passed the filters, but it should be slicers. It's possible. Please refer to https://github.com/Microsoft/PowerBI-JavaScript/wiki/Slicers and the live demo

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.