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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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