Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
Hope all is well.
I am working on a paginated report which contains a matrix made of
two Row groups having
and have a 1 column group of Report Date with a column named "current date" & "previous date".
The resultant needs to be top 10 Area which was easy to achieve but the issue is unable to calculate the Grand total of top 10 returning Areas.
Would really appreciate if anyone can assist me in this regard and let me know how to calculate the Grand Total of Top 10 Areas in a matrix.
Please assist me if possible, I'll be grateful to you.
Thank you for the assistance, Sahir.
However, the given solution isn't returning the filtered rows total.
I have tried your solution for Top 2 rows, keeping everthing quite simple.
This is the design view: I have chosen Branch Banking in the Main Category group only.
This is the resultant view: Sum should be 7 instead of 9.
Hello @IK181,
Can you please try the following:
1. Define a custom code function in the report:
Dim TotalTop10Areas As Integer = 0
Public Function AddToTotalTop10Areas(ByVal value As Integer) As Integer
TotalTop10Areas = TotalTop10Areas + value
Return value
End Function
Public Function GetGrandTotalTop10Areas() As Integer
Return TotalTop10Areas
End Function
2. Add a textbox to your report where you want to display the grand total. In the Value property of the textbox:
=Code.GetGrandTotalTop10Areas()
3. In the cell of the matrix where you want to calculate the top 10 areas, add a custom expression to handle the top 10 calculation
=Code.AddToTotalTop10Areas(Sum(Fields!ValueToSum.Value))
4. Sort the matrix rows by the sum of the values in descending order.
Should you need further assistance please don't hesitate to reach out to me.
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 |
---|---|
6 | |
3 | |
2 | |
2 | |
1 |
User | Count |
---|---|
6 | |
4 | |
4 | |
3 | |
3 |