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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

URL Parameters in view mode

Hello there,

 

Few months ago POLITICO publised an nice data viz:

https://www.politico.eu/europe-poll-of-polls/european-parliament-elections-2019/

 

I would like to replicate it:

 

They have an EU page where show aggregate data. On the top there flags where you could select a Memeber States in order to drill-down on country level.

 

They change member states using the paramenter Country, therefore when they click Austria they go to the following link: 

 

https://app.powerbi.com/view?r=eyJrIjoiZTA5N2VkYWQtYmNiMS00YWFmLWEwZWQtOGY4MmExNTlmZjllIiwidCI6ImMyO...

 

When they click Belgiumthey go to the following link:

 

https://app.powerbi.com/view?r=eyJrIjoiZTA5N2VkYWQtYmNiMS00YWFmLWEwZWQtOGY4MmExNTlmZjllIiwidCI6ImMyO...

 

and so on.

 

I know  that there is a service url filter doc, see the link below

https://docs.microsoft.com/en-us/power-bi/service-url-filters

but they use another way to write the URL ==> URL?filter=Table/Field eq 'value'. I would like to have like POLITICO URL&Country=Austria

 

Does anyone know I could develop something like this?

 

Thank you very much for your example.

Salva

4 REPLIES 4
okanzka
New Member

Hello anonymous, I'm exactly need the same as the Politico dashboard but could not find how to implement and made that filters works this way. I'm really wondering, did you find the answer and implement it accordingly ? 

v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

Embedding report with JavaScript can have the effect. You could try the script below :

 

function show(pageName, filterValue){
//Set the baseUrl to the embed url you get from the Power BI UI
var newUrl = baseUrl + "&pageName=" + pageName;
if(null != filterValue && "" != filterValue)
{/code>
newUrl += "&Country='" + filterValue + "'";
}
//Assumes there’s an iFrame on the page with id="iFrame"
var report = document.getElementById("iFrame");
report.src=newUrl;
}

For more details, you could reference the blog : Easily embed secure Power BI reports in your internal portals or websites.

 

 

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello @v-xuding-msft ,

 

Thank you for your help, it is very help a lot.

 

Howerver, I was thinking to replicate the POLITICO page like this

 

https://app.powerbi.com/view?r=eyJrIjoiZTA5N2VkYWQtYmNiMS00YWFmLWEwZWQtOGY4MmExNTlmZjllIiwidCI6ImMyO...
&pageName=ReportSectionfc084e199e4490b57ced&Country=Spain

 

as you could see they have publish like "Public to web" so everyone could see the data and they have added a paramenter country where you could change from one to another member states.

 

Do know how I can create the parameter when I use "Public to web" as well?

 

Thanks,

Salva

Hi @Anonymous ,

As I known, URL parameters is not supported to "Publish to web".  For now, there is no functionality to implement it directly. It needs us to develop with javascript like that website did.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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