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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
NJ81858
Helper IV
Helper IV

Scope in Sum Report Builder

Hello,

 

I am trying to define expressions for a matrix within report builder and I keep getting errors.

 

This is what the Matrix should look like:

NJ81858_0-1687347443473.png

Note that the value for Percent for each group, called "Team" in my dataset, is the percent of the total, such as 52/196 = 26.53%, and the percent allocated to each value of "Yes" and "No" is the percent within that specific Team. 

 

In Report Builder I have an expression set up that gives me the correct percentage for the total of each Team, a.k.a. the values in Gray, but whenever I define a scope of Team within my sums for values of Yes and No, it gives me the following error: 

"The 'Value' expression for the text box 'Count2' has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset."

 

My expression that gives me the correct percentage for the total of each Team is 

Sum(Fields!Count.Value) / Sum(Fields!Count.Value, "DataSet1")

in which "Count" is just a simple field that is always 1, allowing me to sum that field and imitate a Count.

 

My expression that gives me the error for the percent within each Team is: 

Sum(Fields!Count.Value) / Sum(Fields!Count.Value, "Team")

 

I know that the field for Team is called "Team" because i am using that scope in another matrix and it gives me the correct values. I just am not sure where I am going wrong. Thank you in advance!

1 REPLY 1
d_gosbell
Super User
Super User

That error would imply that your row group in your report (see the image below) is not called "Team" but has some other name. If this is the case you can either go into the group properties and rename it or you can use the group name in your expression.

d_gosbell_0-1687396841176.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.