Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I'm trying to get used to Power BI Desktop, and seem to need a little boost either getting started, or understanding the limitations.
I want to build a sample dashboard, and what better way to get started than have a dashboard bubble up info I am familiar with, right?
But Right away, since I manage multiple servers, I need to be able to change the server name from a drop down menu, and have the queries refresh.
If I could get just one dang query to do that, i could run with the ball from there.
I found an article that kind of shows how to get a connection to use a variable, but it's not working for me so far. I get confused about why i HAVE to use excel, instead of a query or static list, and the half dozen iterations I've tried never worked. I get killed in DAX/BI syntax.
I want a query available that shows me all my servers from central Management Server, easy enough right?
SELECT DISTINCT name,server_name FROM msdb.[dbo].[sysmanagement_shared_registered_servers]
it could just as well be a select from a static list, ie SELECT'(local) AS name UNION ALL SELECT '(local)\SQLEXPRESS', but it needs to be a refreshible query to occasionally get the new server list.
So i can get that into a PowerBI Desktop data, but i'm not seeing how to get something to assign to a variable, so that i could then use that variable to modify a connection string.
so say i wanted to just run the most basic query, something like this:
SELECT
SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS ComputerNamePhysicalNetBIOS,
SERVERPROPERTY('Edition') AS Edition,
s.cpu_count ,
s.hyperthread_ratio ,
s.cpu_count / s.hyperthread_ratio As NumberofCores,
s.physical_memory_kb/1024 As MemoryinMb,
s.virtual_machine_type_desc,
CASE WHEN s.virtual_machine_type > 0 THEN 'Virtual' ELSE '' END As IsVirtual--1 = hypervisor, 2 = other type of virtual
FROM sys.dm_os_sys_info s
if i got that to work, i could then use the same logic on other queries, and have dozens of other objects in a dashboard that pulls various details a DBA would care about.
there is a brief article on Power BI Tutorial: How to Parameterize Connection Variables in Power Query at
https://businessintelligist.com/2015/05/12/power-bi-tutorial-how-to-parameterize-connection-variable..., but i need a better leg up, than that two year old article.
Has anyone ever done what I'm asking? can you get a drop down selection to assign a value to a variable, so that connection strings would refresh?
Solved! Go to Solution.
In the PowerBI-world what you're looking for is filed under "parameters". Check out the following articles:
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
http://biinsight.com/power-bi-desktop-query-parameters-part-1/
https://www.excelguru.ca/blog/2016/04/28/pass-parameters-to-sql-queries/
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
See link below for choosing Query in the Suggested Values dropdown box.
https://blog.crossjoin.co.uk/2016/08/30/data-driven-power-bi-desktop-parameters-using-list-queries/
See link below for choosing Query in the Suggested Values dropdown box.
https://blog.crossjoin.co.uk/2016/08/30/data-driven-power-bi-desktop-parameters-using-list-queries/
In the PowerBI-world what you're looking for is filed under "parameters". Check out the following articles:
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
http://biinsight.com/power-bi-desktop-query-parameters-part-1/
https://www.excelguru.ca/blog/2016/04/28/pass-parameters-to-sql-queries/
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
82 | |
65 | |
51 | |
31 |
User | Count |
---|---|
117 | |
116 | |
71 | |
64 | |
40 |