Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I'm using the following measure to calculate the annual average for a data set.
My data covers the whole 2022 year and yet to date 2023.
Could someone please help me adjust this measure to only catch the avarage for 2022.
Solved! Go to Solution.
Average =
VAR _t1 = YEAR(TODAY())-1
RETURN
CALCULATE(AVERAGEX(VALUES('Calendar_lookup'[Date].[Year]),[1.2 % of components]), ALLEXCEPT('Calendar_lookup','Calendar_lookup'[Year]),'Calendar_lookup'[Year]=_t1)
or
or
Average =
VAR _t1 = YEAR(TODAY())-1
RETURN
CALCULATE(AVERAGEX(VALUES('Calendar_lookup'[Date].[Year]),[1.2 % of components]), ALLEXCEPT('Calendar_lookup','Calendar_lookup'[Year]), CALCULATETABLE('Calendar', 'Calendar_lookup'[Year]=_t1))
Average =
VAR _t1 = YEAR(TODAY())-1
RETURN
CALCULATE(AVERAGEX(VALUES('Calendar_lookup'[Date].[Year]),[1.2 % of components]), ALLEXCEPT('Calendar_lookup','Calendar_lookup'[Year]),'Calendar_lookup'[Year]=_t1)
or
Measure =
VAR _t1 = YEAR(TODAY())-1
RETURN
CALCULATE(AVERAGEX(VALUES('Calendar_lookup'[Date].[Year]),[1.2 % of components]), 'Calendar_lookup'[Year]=_t1)
hi @Ahmedx
The problem with your solution is that it eliminates the ALLEXEPT statement, I need to show the average as a straight line on the Line a clustern column chart. Whitout this statment it calculate trhe avarge for every month
CALCULATE(AVERAGEX(VALUES('Calendar_lookup'[Date].[Year]),[1.2 % of components]), 'Calendar_lookup'[Year]=2022)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |