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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
unknown917
Helper IV
Helper IV

Using parameters to filter to desired number of rows

I created a table to show all possible serial numbers (with type) according to hub & subset.  I want to use parameters to allow the end user to filter to the desired number of serial numbers per the hub & subset.  I have filters for hub & subset.  The end user would supply the number of serial numbers in the parameter field to filter to according to the type of serial number needed.  The desired result would be something like:  parameter 1 = 10, parameter 2 = 5

 

parameter 1 =

1

2

3

4

5

6

7

8

9

10

parameter 2 = 

1

2

3

4

5

 

The end user would then export out the table for further use.

 

Any help would be greatly appreciated.

 

1 ACCEPTED SOLUTION
Murtaza_Ghafoor
Continued Contributor
Continued Contributor

Create a What-If Parameter

Go to Modeling → New Parameter → Numeric Range

Create:

Parameter 1 (for Type 1)

Parameter 2 (for Type 2)

 

Power BI will automatically create a slicer, create a measure, connect everything dynamically

Users can:

Select 5, 10, 20, etc.

See rows update instantly

Export the filtered table

 No refresh needed.

If this helps, Mark as Kudos | Mark as Solution| Help Others

View solution in original post

4 REPLIES 4
V-yubandi-msft
Community Support
Community Support

Please take a moment to review the details shared by @Murtaza_Ghafoor and confirm whether they align with your expectations. Let us know if you require any additional assistance or clarification.

 

Regards,
Yugandhar

Murtaza_Ghafoor
Continued Contributor
Continued Contributor

Create a What-If Parameter

Go to Modeling → New Parameter → Numeric Range

Create:

Parameter 1 (for Type 1)

Parameter 2 (for Type 2)

 

Power BI will automatically create a slicer, create a measure, connect everything dynamically

Users can:

Select 5, 10, 20, etc.

See rows update instantly

Export the filtered table

 No refresh needed.

If this helps, Mark as Kudos | Mark as Solution| Help Others

grazitti_sapna
Super User
Super User

Hi @unknown917 

Yes, you can do this with parameters in Power Query. Have you try the following 

  1. Create 2 Number parameters (Home > Manage Parameters):
    • Param1 = 10 (default)
    • Param2 = 5 (default)
  2. In your serial numbers query, add Custom Column or Advanced Editor step:

create a DAX:
if [Type] = "Type1" then
    List.FirstN(Table.RowCount(AllSerials), Param1)
else if [Type] = "Type2" then
    List.FirstN(Table.RowCount(AllSerials), Param2)
else null

 

Then, Filter to keep only rows where this column is not null.

 

Result: Users change Param1/Param2 values → refresh → get exactly 10/5 rows per type. Export works perfectly.

 

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

🔗 Curious to explore more? [Discover here].

Let’s keep building smarter solutions together!

Thank you, @grazitti_sapna .

 

Unfortunately, the end user will not have the ability to refresh the model.  This is to be set as a published report.  Is it possible to create a visual parameter that will accomplish the same?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.