Forum Discussion

fjjpeeters1976's avatar
fjjpeeters1976
Helper III
2 years ago

Changing calculation logic on aggregation level

Hi all,

 

I have the following problem, hope you can help me find a solution. Unfortunately it is difficult to share a .pbix for it. Let me explain and maybe you can give me some tips which DAX functions to try.

 

I want to create a report that shows the emissions for electricity, for that I take the electricity consumption by country and multiply it with factor A and factor B which are both country and year specific.

On country levels I get the correct results but on Europe level I want to add the emissions from the countries together and I do not want the system to add up factor A, add up factor B and multiply these numbers with the total electricity. This is what it does now, I end up with emission of 33,023. However I want to end up with 27,310

 

 SiteCity  Month  Year  Emission  Factor A  Factor B  Electricity 
 Europe  Jan 202333,0233590.1232,664
 Germany  Jan 202320,01290.0732,225
 Sweden  Jan 20237,2983500.05439

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  fjjpeeters1976 ,

     

    Would you mind explaining the logic of the "27,310" operation?

    If it's convenient, you can use a picture to show your expected result so we can help you better!

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • fjjpeeters1976's avatar
      fjjpeeters1976
      Helper III

      Hi Liu,

       

      The 27,310 would be the sum of 20,012 for Germany and 7,298 for Sweden. So every country has a specific factor A and factor B, this is multiplied with the electricity consumption to get the emission. On Europe level however we do not have a europe specific factor A or B, so we cannot add them up and multiply them with the electricity (factor A and factor B are just intermediate steps, they will not be shown in any graphs). So for Europe it just needs to add up the emission totals and not calculate it again using summed factor A and factor B