Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
56 | |
22 | |
19 | |
16 | |
11 |
User | Count |
---|---|
85 | |
54 | |
39 | |
21 | |
17 |