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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
fraitaan
Frequent Visitor

Calculate average between 2 columns, per year.

Hi, 

I have 3 columns.
- System Power

- Power

- Year

All in the same table. 

I want to calculate the average difference between System Power and Power, visualise the difference per year. 

How should I do it? 

I've tried using formulas like: 

 

Average Difference by Forecast Year =
AVERAGEX(
    VALUES('Data'[Year]),
    CALCULATE(
        AVERAGE('Data'[System Power]) - AVERAGE('Data'[Power])
    )
)

 


Also tried to make a new column called: "Power Difference" where I used M-code: 

 

[#"System Power"] - [#"Power"]

 


I tried to use average on it but I only get the same value over all the years: 

fraitaan_0-1683014012069.png

 


Thanks

4 REPLIES 4
tamerj1
Super User
Super User

@fraitaan 

Please make sure to use a year column which is in the same table or in a dimension table that filters this table. 

eliasayyy
Memorable Member
Memorable Member

hello please try 

average difference by year = 
VAR avgp = CALCULATE(AVERAGE('Table'[Power]),ALLEXCEPT('Table','Table'[Year]))
VAR avgsp = CALCULATE(AVERAGE('Table'[System Power]),ALLEXCEPT('Table','Table'[Year]))
VAR diff = avgp - avgsp
RETURN
AVERAGEX(VALUES('Table'[Year]),diff)

Hi, 

Thanks for answer

Still got the same value over all years

fraitaan_0-1683019744472.png


I need to see the difference between each year.

as @tamerj1 stated, do you have a seperate table for year? or what did you include in the column chart which column

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.