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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AdamGarcia_SCTA
Frequent Visitor

Difference Value in same column between years

Hello,

I'd like help and/or recommendations for adding a new indicator Card for a greenhouse gas dashboard that calculates the difference of GHG emissions between two years. All the emissions data is in a single column organized by year.

 

The simple indicator:

The Card would show the difference in total GHG emissions (‘Activity’[Metric Tons of Carbon Dioxide Equivalent]) between 1990 and 2020 and would change depending on the three filter on the bottom of the page for: Jurisdiction, Activity Type, and Activity Name.

Simple Indictor - Change 1990 to 2020.png

 

The complicated indicator:

Similar to above, only the indicator Card would show the difference in total GHG emissions between the year chosen in the Year filter at the bottom of the page and 2020, with the three other filters still in effect as above. If possible, the indicator Card title would also have to change depending on the year filter chosen at the bottom of the page.

Complicated Indictor - Change 1990 to 2020.png

 

Is there a way to do this in the existing 'Activity' table, or would a new table be needed?

 

Thank you for your help,

 

Adam

 

link: power bi ghg dashboard

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

you had that as a calculated column, but you need a measure

 

lbendlin_0-1712512996850.png

 

Dif 1990 to 2020 = SUMX(FILTER(ALL(Activity), Activity[Year]=1990), [Metric Tons of Carbon Dioxide Equivalent]) - SUMX(FILTER(ALL(Activity), Activity[Year]=2020), [Metric Tons of Carbon Dioxide Equivalent])

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

you had that as a calculated column, but you need a measure

 

lbendlin_0-1712512996850.png

 

Dif 1990 to 2020 = SUMX(FILTER(ALL(Activity), Activity[Year]=1990), [Metric Tons of Carbon Dioxide Equivalent]) - SUMX(FILTER(ALL(Activity), Activity[Year]=2020), [Metric Tons of Carbon Dioxide Equivalent])

Thank you, though I received an error. This should be obvious but not sure what needs changing.

 

The syntax for '1990' is incorrect. (DAX(Dif 1990 to 2020 = SUMX(FILTER(ALL(Activity),Activity[Year]=1990), [Metric Tons of Carbon Dioxide Equivalent]) - SUMX(FILTER(ALL(Activity), Activity[Year]=2020), [Metric Tons of Carbon Dioxide Equivalent]))).

What is the (DAX... part supposed to do?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors