Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi. I have filters in reports (See attached screehshot)
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).
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'
Is it possible to show all values in the filter dropdown and passed values should be selected by default?
Hi @rsathish_red,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
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
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
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
91 | |
51 | |
48 | |
47 |