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 dear community, I come to you so that you can help me with this DAX calculation.
I need a Calculated Column to show me:
Year Filter: 2021
Current month: May2021 (5)
Seniority of the collaborator to May2021: 3 months (that is, the collaborator appears 3 times until May,
if in June it becomes active, the collaborator when we are in June then it will appear 4 times, and so on)
So the average will be = (Mar + Apr + May) / 3
Also consider that I already have a calendar table in my Power BI.
Here I have an example sample of what I want exactly (column "Average Last 6 months), you can download the file here:
I also leave the extract here:
I read them, I hope they can help me as soon as possible. and thank you very much in advance.
Nestor Reyes
Solved! Go to Solution.
AVG 6M =
CALCULATE(
AVERAGEX( DATA, DATA[Compensation] ),
DATESINPERIOD( DATA[Date], MAX( DATA[Date] ), -6, MONTH )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
AVG 6M =
CALCULATE(
AVERAGEX( DATA, DATA[Compensation] ),
DATESINPERIOD( DATA[Date], MAX( DATA[Date] ), -6, MONTH )
)
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |