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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors