Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi Team ,
There is a requirement where we need to show the total page number of the sub report in the parent report for paginated reports using Power BI report builder .
Could you please suggest any good solution for implementing the same ?
Thanks & Regards,
Nitish
Solved! Go to Solution.
Go to Report > Report Properties > Code
Public Shared SubReportPageCount As Integer
Public Function GetSubReportPageCount() As Integer
Return SubReportPageCount
End Function
Public Sub SetSubReportPageCount(ByVal pageCount As Integer)
SubReportPageCount = pageCount
End Sub
In your subreport, create a text box and set its value to the following expression
=Code.SetSubReportPageCount(Globals!OverallTotalPages)
In the parent report, create a text box and set its value to the following expression
=Code.GetSubReportPageCount()
or you could use a parameter, "SubReportTotalPages" in the subreport with a value of =Globals!OverallTotalPages and pass the parameter to the parent report by adding the same named parameter to the parent report and set the value to the subreport's parameter.
In the parent report you could then just reference the parameter
=Parameters!SubReportTotalPages.Value
Thank you @aduguid for your suggestions 🙂 !!!!
We will try this above approach and check where it is working or not !!! Thanks for your support.
Go to Report > Report Properties > Code
Public Shared SubReportPageCount As Integer
Public Function GetSubReportPageCount() As Integer
Return SubReportPageCount
End Function
Public Sub SetSubReportPageCount(ByVal pageCount As Integer)
SubReportPageCount = pageCount
End Sub
In your subreport, create a text box and set its value to the following expression
=Code.SetSubReportPageCount(Globals!OverallTotalPages)
In the parent report, create a text box and set its value to the following expression
=Code.GetSubReportPageCount()
or you could use a parameter, "SubReportTotalPages" in the subreport with a value of =Globals!OverallTotalPages and pass the parameter to the parent report by adding the same named parameter to the parent report and set the value to the subreport's parameter.
In the parent report you could then just reference the parameter
=Parameters!SubReportTotalPages.Value
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
2 | |
2 | |
2 | |
1 |
User | Count |
---|---|
7 | |
5 | |
4 | |
3 | |
3 |