The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
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.
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
Solved! Go to Solution.
you had that as a calculated column, but you need a measure
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])
you had that as a calculated column, but you need a measure
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?