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
MikeDubya
Helper I
Helper I

REPORT BUILDER Question - How to Filter a Parameter

Hello,

I want to filter my Parameter to only show values with data.

Example, I am pulling in a bunch of email addresses and using that as my Parameter. User selects an email address and a list of items shows for that email in the report.

What I would like is, if an email has no rows/items to display, then it isn't an option in the parameter.

So if I have these email addresses and a count of rows for each :

abc@email.com      5 rows

123@email.com       3 rows

me@email.com        0 rows

 

then the paramter in the report only gives you the option to select either "abc" or "123".

If that data changes the next day/week, i.e. "me" now has 2 rows and "abc" has 0, then the options to select are only "123" or "me".

If nothing has data, then nothing to select, else if it all does then I can select any email address.

 

Any help would be appreciated!

 

 

 

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

Hi, @MikeDubya 

Based on your descriptive information, I have the following dataset:
Table1

vjianpengmsft_0-1721109549270.png

Additionally, as you mentioned you have a table of email address statistics:
Table2

vjianpengmsft_1-1721109582520.png

 

In Report builder first use dataset1 to create a dataset1, select Filters to filter the Count column to non-zero:

vjianpengmsft_2-1721109613183.png

vjianpengmsft_3-1721109620273.png

Create a new parameter:

vjianpengmsft_4-1721109652008.png

vjianpengmsft_5-1721109660433.png

vjianpengmsft_6-1721109669427.png

Import table1 into report builder and create a dataset2:.

vjianpengmsft_7-1721109692049.png

In filter, select fx, and set it to the parameter you just created:

vjianpengmsft_8-1721109716765.png

vjianpengmsft_9-1721109723305.png

After setting it up, the result of putting dataset2 into the table is as follows:

vjianpengmsft_10-1721109754187.png

vjianpengmsft_11-1721109761798.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
MikeDubya
Helper I
Helper I

I was able to actually follow these steps and change the conditions a bit to fit my needs and it worked. Thanks for the help!

MikeDubya
Helper I
Helper I

I should also mention that it is one Table, not two.

MikeDubya
Helper I
Helper I

I apologize, I didn't do a good job giving example data. Let me try again.

What we have is a list of emails with dates. 

Email AddressDate
abc@email.com7/20/2024
abc@email.com7/21/2024
abc@email.com7/22/2024
123@email.com7/21/2024
123@email.com7/22/2024
123@email.com7/27/2024
123@email.com7/28/2024
me@email.com7/26/2024
me@email.com7/27/2024
me@email.com7/28/2024
me@email.com7/29/2024

 

We want to only see email addresses in the parameter where the date is within 7 days. So if todays date is 7/17/2024, based on the dates above, only these would appear:

abc@email.com
123@email.com

 

Then if we select an email, the report populates with the appropriate data. We have that part working. We just want to remove any emails with no rows that are within 7 days of "todays" date from the dropdown parameter. 

 

I hope that makes a bit more sense. I do believe what you are showing is close but we couldn't get it to work based on how I had previously described the data. Does that change anything for you?

 

v-jianpeng-msft
Community Support
Community Support

Hi, @MikeDubya 

Based on your descriptive information, I have the following dataset:
Table1

vjianpengmsft_0-1721109549270.png

Additionally, as you mentioned you have a table of email address statistics:
Table2

vjianpengmsft_1-1721109582520.png

 

In Report builder first use dataset1 to create a dataset1, select Filters to filter the Count column to non-zero:

vjianpengmsft_2-1721109613183.png

vjianpengmsft_3-1721109620273.png

Create a new parameter:

vjianpengmsft_4-1721109652008.png

vjianpengmsft_5-1721109660433.png

vjianpengmsft_6-1721109669427.png

Import table1 into report builder and create a dataset2:.

vjianpengmsft_7-1721109692049.png

In filter, select fx, and set it to the parameter you just created:

vjianpengmsft_8-1721109716765.png

vjianpengmsft_9-1721109723305.png

After setting it up, the result of putting dataset2 into the table is as follows:

vjianpengmsft_10-1721109754187.png

vjianpengmsft_11-1721109761798.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.

 

 

 

 

 

 

 

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 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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