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
Anonymous
Not applicable

Report Builder: How to create a Calculated Field using data from 2 different Data Sets

Hi,

 

I'm very familiar with Power BI Desktop but new to Power BI Report Builder.

 

My question is:  Is it possible to create a calculated field in Power BI Report Builder using data from 2 different Data Sets?

 

For example, I'd like to create a calculated field like the following:

PMPM

= ((Sum(Fields!PlanPaid.Value, "Claims_Rolling12")) / (CountDistinct(Fields!EmployeeID.Value, "Eligibility_Rolling12")))

 

It would be using the Sum of [PlanPaid] from my "Claims_Rolling12" Data Set and dividing it by the Distinct Count of [EmployeeID] from my "Eligibility_Rolling12" Data Set.

 

I would need the table to look like this:

555.PNG

 

Both the Claims_Rolling12 Data Set and Eligibility_Rolling12 Data Set have a column called Date that is formatted the same.  I'm just having trouble creating the Calculated Field.

 

Is this type of thing possible in Report Builder?

 

 

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You cannot add the twor results directly. You need to do it using a custome code in SSRS.

Hope these links will help you:

 

http://www.bidn.com/blogs/MarkGStacey/bidn-blog/2714/aggregated-lookups-in-ssrs-2008r2
http://stackoverflow.com/questions/8093443/how-to-combine-aggregates-within-a-group-with-aggregates-across-groups-within-ss


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi, yes it is possible. 

You need to link the two tables in the data model to create relationship between them so the filters can propagate. 

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.