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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mecrbpower
Regular Visitor

Paginated Report fetching all data when using a parameter

Hi

I have created a Power BI dataset which shows all sales invoices for the last number of years. The Power BI report uses SQL query. I am retrieving approx 50 columns and can have approx 200,000 records of data. The Power BI query and visuals within the Power BI report work fine with no performance issues.

From this dataset I have created a paginated report. The report will be used to display an actual sales invoice. The report passes in a paramater of Invoice ID and then display the actual sales invoice.

This all works fine except it is very slow. 

 

When I enter the Invoice ID and 'View Report', the report shows the 'Fetching Data' window. It reads through all the 200,000 records each time I run the report and then dislays the actual invoice data(paginated report).

 

I would imagine this is not correct and that I can somehow but a key on the data and retrieve the required invoice data quicker.

 

Many thanks for your help

Michael

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @mecrbpower 

I'm not sure if I understand correctly: do you mean that your final result can be filtered with the correct data by the parameter, but before filtering the data it will load all the data resulting in lower performance?


May I ask what connection mode your semantic model is using to connect to SQL Server? If you are using import mode, I suggest you to recreate a new semantic model using DirectQuery mode.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
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

5 REPLIES 5
JulsC
New Member

Hi, did you get a solution for your problem as I am experiencing the same.  I can see you accepted the change from ImportQuery to DirectQuery but I already use DirectQuery with the same issue?

mecrbpower
Regular Visitor

Hi Fen

 

Many thanks for your reply.

 

I am not using SQL in the paginated report. I am using a Power BI Dataset. And then using a filter on the data.  I will try and show what I have setup.

       

I have 2 Datasets in the report. See my Dataset properties

mecrbpower_7-1730971584064.png

 

Dataset = InvoiceParameter

I use this in my parameter dropdown to show all invoices

mecrbpower_8-1730971617119.png

 

Dataset = Dataset1

This retrieves all the required data. I use a filter on this Dataset

 

mecrbpower_9-1730971645667.png

 

Filter on this Dataset

mecrbpower_10-1730971677734.png

 

The report works fine in that I can select the Invoice from the parameter and the correct invoice details are returned to the report. The issue is performance. Each time I run 'View Report' the report it fetches all the records.  See window, it counts through all the rows sequentially, so If I have 200,000 rows it fetches 200,000 records

mecrbpower_11-1730971707038.png

 

 

thanks again for your help

regards

Michael

 

 

 

 

 

 

Anonymous
Not applicable

Hi, @mecrbpower 

I'm not sure if I understand correctly: do you mean that your final result can be filtered with the correct data by the parameter, but before filtering the data it will load all the data resulting in lower performance?


May I ask what connection mode your semantic model is using to connect to SQL Server? If you are using import mode, I suggest you to recreate a new semantic model using DirectQuery mode.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi Fen

Thanks and really appreciate your input. I will try and explain more clearly what my issue is.

I have a Power BI report that retrieves the data from my ERP system. I use Direct Query within the Power BI report.  I have then published this report in Power BI service.  There are no performance issues on the Power BI report.

Then I create my paginated report over this dataset of data.  The report is to accept as input a parameter of Invoice ID.  When the report is run ‘View Report’ the invoice details for the passed invoice ID is displayed.  This is all correct and working OK.

The issue is performance.  When I Run the report it fetches ALL records from the dataset, it seems to be reading sequentially through each row of data. How can I stop the report fetching all records, only fetch the one record I am looking for.

 

regards

Michael

Anonymous
Not applicable

Hi, @mecrbpower 

I am glad to help you.

 

Please check if you have bound the parameter to the SQL query:

 

First, you can try to check your SQL query where you are using Invoice ID parameter directly. This way, the database will only fetch the relevant records:

vfenlingmsft_5-1730946370442.png

 

SELECT
  SalesInvoices.InvoiceID
  ,SalesInvoices.[Values]
FROM
  SalesInvoices

Where SalesInvoices.InvoiceID IN (@InvoiceID)

 

vfenlingmsft_6-1730946392599.png

 

 

Result:

vfenlingmsft_4-1730946340649.png

 

 

Of course you can also use the Invoice ID parameter without adding a Where clause to the SQL statement, but instead bind the parameter in Filters in the dataset for filtering:

vfenlingmsft_2-1730946214127.png

 

vfenlingmsft_0-1730946123403.png

 

vfenlingmsft_1-1730946168497.png

 

Result:

vfenlingmsft_3-1730946273460.png

 

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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