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
LudwigGdn
New Member

Sum two lines under conditions

Hi guys,

I am stuck on a problem,

I have different tables : DIM_Energy,DIM_Country, FACT_Energy_Mixed
In my table FACT_EnergyMixed, I have the following colum :

CountryCode : Contain the code of the country that refer to a country in DIM_Country

EnergyCode : Contain the code of the energy (gaz, electricity etc ...) that refer to a country in DIM_Energy. There is for each energy an indicator 'Y'/'N' to say if it's a clean or unclean energy

ValueEnergtMix: The value produce for an energy and a country for one year

Year: The years from 2000 to 2022

 

I try to find the pourcentage of evolution between 2000 and 2022 for the clean and for the unclean energy.

For now I tried two differents methods :

 

LudwigGdn_0-1718270728951.png

 

LudwigGdn_0-1718269672847.png

And I get that :

LudwigGdn_1-1718270770504.png

 

LudwigGdn_1-1718270027434.png

The thing is I would like that after the calcul of the pourcentage, it makes the sum of the value.
Fx, for France, it should do -29.70 + (-29,01) + 2857,23 = 2,798.52

I don't really understand how it does the calcul, but it's not what I want.

I tried also on the recommandations to chatgpt and it gave me that :

LudwigGdn_2-1718270806494.png

 

LudwigGdn_4-1718270431027.png

with Valeur2020 and Valeur2022 equal :

LudwigGdn_3-1718270832229.pngLudwigGdn_4-1718270856330.png

 

LudwigGdn_5-1718270485990.png

LudwigGdn_6-1718270525294.png

After that, it told me to filter on the country and the energy but I obtain the same problem.
Could anyone could help me ?

 



1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

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.