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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
moorotter
New Member

Calculate column based on dynamique value (Example file attached)

Hello,

 

In the context of calculating carbon footprints for products, I need to calculate how often specific parts of a product need to be replaced. My difficulty lies in the fact, that I want to be able to change the lifetime of the product using a slider to analyse the impact of varying lifespans.

In my data, I have a column which an expected lifetime for each part. The lifetime of the product is devided by the lifetime of the part and subsequently rounded up to get the number each part needs to be replaced over the entire lifespan of the the product. This number of replacements can be multiplied by the carbon footprint of each part and I can then sum up the footprints of all the parts to get the product carbon footprint.

Example

Expected lifetime of a car (product) = 25 years
Expected lifetime of wheels (part) = 10 years

25/10 = 2,5 --> 3
Carbon footprint of 1 set of wheels: 100 kg CO2

3 * 100 kg = 300 kg CO2 for the wheels over the lifespan of a car.

However, I want to change the expected lifespan of my product, so I can analyse different scenarios.

I created a parameter with a slider called lifespan. My idea is, to devide the value of the slider (indicating product lifetime) by the lifetime of each part to get the number of replacements.
Unfortunately, I cannot calculate a second column by the selected value of the slider.
Do you have any idea, how I can tackle this problem? I think, I cannot use a measure to calculate this, since each line needs to be individually calculated to find the number of replacements. I think I need a calculated column which is connected to the value of the slider but this does not work. A different solution which leeds to the desired result is also appreciated.

Below an example for the data:

PartLifetimecarbon carbon footprint per part
wheels10100
windshield1550
engine25300


Desired output something like this but in powerBI and with the lifetime car flexible:

PartLifetimecarbon footprint per partlifetime prod/lifetime partnumber of parts requiredcarbon footprint per part
wheels101002,53300
windshield15501,6666666672100
engine2530011300
    Total carbon footprint700


I will attach an example Excel and PowerBI-file with the slider already included. 
https://www.dropbox.com/scl/fo/nzl0lrp5cqdf9sikw87kk/AKvzuFVgOF8-52VB_Jug2eo?rlkey=n7405spmoiqkgdfjl...

Thank you for your help!

1 REPLY 1
ajohnso2
Super User
Super User

You cannot calculate this in columns or tables since you want it to be dynamic, calculated columns are stored in the model and only update on refresh (not responsive to slicer changes). 

What if parameters could be worth looking into.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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