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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate a new metric based on data from another column that needs to be dynamic as it rolls up

Hi there. This is my first post so if I'm not posting properly please let me know and I'll improve my forum etiquete 🙂

 

I'm building a model in PowerBi that will help us calculate emissions for our company. I'm pulling in data from many sources and then calculating the emissions using factors that I've uploaded to a table and reference using the "Related" function. Our industy uses "Emissions Intensity" as a KPI. Emissions intensity is "metric tonnes of CO2e emitted" divided by "volume produced". I've tried to add a column that just divides my "Ttl_CO2e" column by my "Vol" column but when i agg it up it sums the intensity metric, when really it should sum the Ttl_CO2e and divide that by the sum of the Vol. I also searched for a solution on here and there was one post where a measure was used by creating two "sum" measures and then dividing those. The issue is I'd like to be able to put it on a graph and filter down levels in the hierarchy and have it pull back the proper calculation for that level of aggregation.

 

So this is what a subset of my data might look like. Right now i have a divide function in there, but when i graph the data at say .... Jan 2022, it can't be the sum of the two, it needs to be the multiplication of what is being filtered. I hope this makes sense! 🙂

 

Thanks so much (I'll get better I promise!)

 

LocationTtl_CO2eVolIntensityDate
115100= divide [ Ttl_CO2e, Vol, 0]Jan 2022
22050 Jan 2022
11575 Feb 2022
21040 Feb 2022
3530 Feb 2022
460400 Feb 2022
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want. You can create a measure as below to get the intensity, the value will change dynamically base on the slicer selections:

Emissions Intensity = DIVIDE ( SUM ( 'Table'[Ttl_CO2e] ), SUM ( 'Table'[Vol] ), 0 )

yingyinr_0-1643161748227.png

If my understanding is not correct, please share some sample data(exclude sensitive data) and your expected result with backend logic and special examples just as suggested by @lbendlin . Thank you.

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want. You can create a measure as below to get the intensity, the value will change dynamically base on the slicer selections:

Emissions Intensity = DIVIDE ( SUM ( 'Table'[Ttl_CO2e] ), SUM ( 'Table'[Vol] ), 0 )

yingyinr_0-1643161748227.png

If my understanding is not correct, please share some sample data(exclude sensitive data) and your expected result with backend logic and special examples just as suggested by @lbendlin . Thank you.

Best Regards

lbendlin
Super User
Super User

Welcome to the forums.

"from another column that needs to be dynamic"  - that is not possible. Columns are static.  You probably meant a measure.

 

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post (as you did already) or use one of the file services. Please show the expected outcome.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.