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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ChrisPBI
Advocate II
Advocate II

Data Model Unit Calculation

Hello,

 

I have a data model, which might have some issues.

 

1.PNG

The Case:
A category can have several models, which come with different properties such as the release date.

A model can have several materials in gram, and a material can be used by several models.

A model has exactly four life cycle stages in which it causes emissions, in the unit kgCO2e.

 

 

 

 

This results in the following field view (unnecessary tables and columns such as the Ids are hidden):

 

3.PNG

 

 

 

 

 

 

 

 

 

 

 

What I try here is to analyze the Greenhouse Gas Emissions and amounts of materials used by Apple products.

This works well when I only use the grams for the materials and the kgCO2e for the emissions.

So it is possible to show in a matrix table, which category emits how much greenhouse gas in which life cycle stage:

 

2.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

But how can I get percent values in such a table?

For example: The MacBook should have 21,29% ((2.967,20 * 100) / 13.940,00) at the stage of customer use.

This would also be helpful when I try to visualize the percentage developments of the emissions.

 

I would be very thankful for any help with this problem!

 

Thanks and Regards,

Chris

1 ACCEPTED SOLUTION
jahida
Impactful Individual
Impactful Individual

Can you try a measure like:

 

Measure = DIVIDE(SUM('Greenhouse Gas Emissions'[kg CO2e], CALCULATE(SUM('Greenhouse Gas Emissions'[kg CO2e]), ALL('PLC Stages'[PLCStage])), 0)

 

Make sure the column in the "ALL" clause is the one on the top axis of your chart, I kind of guessed which one that was.

View solution in original post

3 REPLIES 3
jahida
Impactful Individual
Impactful Individual

Can you try a measure like:

 

Measure = DIVIDE(SUM('Greenhouse Gas Emissions'[kg CO2e], CALCULATE(SUM('Greenhouse Gas Emissions'[kg CO2e]), ALL('PLC Stages'[PLCStage])), 0)

 

Make sure the column in the "ALL" clause is the one on the top axis of your chart, I kind of guessed which one that was.

Hi Jahida,

 

I tried your solution and it seems to work just perfect!!

 

I just had to change to brackets, so the results is:
Measure = DIVIDE(SUM('Greenhouse Gas Emissions'[kg CO2e]); CALCULATE(SUM('Greenhouse Gas Emissions'[kg CO2e]); ALL('PLC Stages'[PLCStage])); 0)

 

Thank you very much, you are a genius!

 

Thanks and Regards,

Chris

CahabaData
Memorable Member
Memorable Member

In the lower portion of your post you display a Report view.

 

If there is a data view (table/query) that has this same set of data - then in the Modeling tab you would add a new column and make it a calculated value.

www.CahabaData.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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