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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.