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
Hello to all,
I am writing to you regarding a DAX request:
I have a table calculating the average electricity production according to a chosen period. This table is synchronized with two segments (Years and months) that allow me to choose the period I want to analyze.
What I would like to do is to add a column to this table that would calculate the average production of the current year (Year N). This would allow me to compare in the same table the values of previous years with the values of the current year.
The problem is that my segments take over my DAX query even when using an ALL function. Here is my query:
As you can see below, I did not select the year 2021 so no result is displayed
If it helps, I have a relationship between a column in my date table and a column in my production table where the electricity production values are:
Thanks in advance for your help,
Have a nice day
Joël
Solved! Go to Solution.
Is Moyenne corrigée periode (MWh) a measure that calculates what you want but for the selected time period instead of this year?
If so, does this work (where 'Year Column' is whatever you've used in the Periode prise en compte slicer) ?
Moyenne corrigée année N (MWh) =
CALCULATE(
[Moyenne corrigée periode (MWh)],
Dates[Year Column]=YEAR(TODAY())
)
Is Moyenne corrigée periode (MWh) a measure that calculates what you want but for the selected time period instead of this year?
If so, does this work (where 'Year Column' is whatever you've used in the Periode prise en compte slicer) ?
Moyenne corrigée année N (MWh) =
CALCULATE(
[Moyenne corrigée periode (MWh)],
Dates[Year Column]=YEAR(TODAY())
)
Hello
Indeed it works, thank you very much @PaulOlding ! Sometimes you don't have to look too hard! ahahah
Have a nice day and thanks again
Bye
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 16 | |
| 10 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 26 | |
| 17 | |
| 14 | |
| 11 | |
| 10 |