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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
lynnma
Helper I
Helper I

Power BI Report Builder

To Whom It May Concern:

 

Note: (Heatlhcare Physicians Report)

 

I am trying to build out a Power BI Report, using Power BI Report Builder.  We are using Power BI Report Server ( ON PREMISES).  The report is simple, pulling in Physician Contact Information.  However, I have made several attempts at building a Parameter based on the Physician's Name.  When I build the parameter out, run the report, I select a Provider, then View.  The results are not a singleton record.  I get all Physicians Names. 

Attempts:

1.) Created Parameter in Power BI Report Builder.  Did not work.

           A.) The Different Report Parameter Properties I have tried:

                  i.) Select from one of the following options:

                         a.) Tried None

                         b.) Tried Specifiy Values

                         c.) Get values from a query.

None of part 1.) Worked.  Get Values from a query was close, but pulled all records.  Its supposed to only pull Physician's Contact Info based on the Name Selected. 

2.) Created Parameter in the SQL CODE: Delcared Parameter, and applied it in the Where Clause.  No syntex errors.

       A.) Created Parameter in PBI Report Builder no succcess.

 

Errors I have received in the past:

1.) ExecuteReader: CommandText property has not been initialized

2.) The report parameter 'SelectPhysName1' has a DefaultValue or a ValidValue that depends on the report parameter "SelectPhysName1". Forward dependencies are not valid.

 

Please provide solution(s).

 

Thank You.

Mark Lynn.

1 ACCEPTED SOLUTION
v-jianpeng-msft
Community Support
Community Support

Hi, @lynnma 

Let's follow my example to learn how to use parameters to filter datasets:

First, here's my dataset:

vjianpengmsft_2-1739511119169.png

Method 1: Create a parameter based on the cource name:

vjianpengmsft_3-1739511225015.png

vjianpengmsft_4-1739511276259.png

vjianpengmsft_5-1739511318455.png

An important step is to apply this parameter to dataset1:

vjianpengmsft_6-1739511415433.png

vjianpengmsft_7-1739511452904.png

vjianpengmsft_8-1739511469334.png

The results are as follows:

vjianpengmsft_9-1739511524892.png

vjianpengmsft_10-1739511558900.png

Method 2, pass the parameters in the query:

vjianpengmsft_11-1739511609494.png

vjianpengmsft_12-1739511691679.png

The results are as follows:

vjianpengmsft_13-1739511759239.png

 

 

Best Regards

Jianpeng Li

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

 

 

 

 

 

 

 

 

View solution in original post

4 REPLIES 4
Poojara_D12
Super User
Super User

Hi @lynnma 

To create a physician contact information report in Power BI Report Builder with a parameter for selecting a physician’s name, follow these steps carefully. First, ensure you have a dataset that retrieves distinct physician names, which will be used to populate the parameter dropdown. Then, create a report parameter named SelectPhysName and set its available values to come from this dataset, ensuring it is a single-selection text parameter. Next, modify the main dataset query to include a WHERE clause that filters records based on the selected physician’s name, using @SelectPhysName as the SQL parameter. After that, go to the dataset properties and correctly map the report parameter to the query parameter to ensure filtering works as expected. If you encounter the "ExecuteReader: CommandText property has not been initialized" error, verify that your dataset query is properly assigned and includes the WHERE clause with the parameter. If you receive the "Forward dependencies are not valid" error, check that your parameter does not have a circular dependency in its available or default values. By following these steps, the report should correctly filter and display only the selected physician’s contact information.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
v-jianpeng-msft
Community Support
Community Support

Hi, @lynnma 

Let's follow my example to learn how to use parameters to filter datasets:

First, here's my dataset:

vjianpengmsft_2-1739511119169.png

Method 1: Create a parameter based on the cource name:

vjianpengmsft_3-1739511225015.png

vjianpengmsft_4-1739511276259.png

vjianpengmsft_5-1739511318455.png

An important step is to apply this parameter to dataset1:

vjianpengmsft_6-1739511415433.png

vjianpengmsft_7-1739511452904.png

vjianpengmsft_8-1739511469334.png

The results are as follows:

vjianpengmsft_9-1739511524892.png

vjianpengmsft_10-1739511558900.png

Method 2, pass the parameters in the query:

vjianpengmsft_11-1739511609494.png

vjianpengmsft_12-1739511691679.png

The results are as follows:

vjianpengmsft_13-1739511759239.png

 

 

Best Regards

Jianpeng Li

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

 

 

 

 

 

 

 

 

Good Morning,

 

Thank you very much for the feedback.  I figured it out late afternoon yesterday.  The sources I was reading and viewing did not mention creating a second data set for the parameter.  This is the major piece I was missing.  The difference between what you posted verses what I completed is I did not create the param in the sql code and setting a condition in the WHERE clause.  I got it to work correctly without having to complete that part.  However, I did create a second data set and called DataParameter, then proceeded on building out the parameter.  

 

I will "Accept as Solution" what you have provided.  Thank you again for responding back promptly!

 

Very Appreciative,

Mark Lynn. 

Vanchy_Liao
Resolver I
Resolver I

Hi @lynnma ,

 

can you describe more specifically the structure you want?

e.g. 

1. create a parameter which get name from query.

2. shows the Physician's Contact Info based on selected name in the report.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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