Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hello everybody,
I am really struggling understanding and realizing measures. I have the following dataset :
And I would like to compute the average of the sum of the total distance in a week for each position.
I tried to create this following mesure but I think that I am missing some informations.
Moyenne Semaine =
AVERAGEX(
SUMMARIZE('Stats_Activités'
, 'Stats_Activités'[Year_Week]
, 'Stats_Activités'[position_name]
, "Distance courue", SUM('Stats_Activités'[total_distance_courue_(m)])
),[Distance courue])Thanks in advance for your help and your time
Solved! Go to Solution.
Hi @maxduff59 ,
You can try this method:
Table =
SUMMARIZE (
'Stats_Activités',
'Stats_Activités'[Year_Week],
'Stats_Activités'[Position],
'Stats_Activités'[Joueur],
"SUM",
CALCULATE (
SUM ( 'Stats_Activités'[Distance] ),
FILTER (
'Stats_Activités',
'Stats_Activités'[Position] = EARLIER ( 'Stats_Activités'[Position] )
&& 'Stats_Activités'[Year_Week] = EARLIER ( 'Stats_Activités'[Year_Week] )
)
)
)Table 2 =
SUMMARIZE (
'Table',
'Table'[Position],
'Table'[Joueur],
"AUG",
CALCULATE (
AVERAGE ( 'Table'[SUM] ),
FILTER (
'Table',
'Table'[Position] = EARLIER ( 'Table'[Position] )
&& 'Table'[Joueur] = EARLIER ( 'Table'[Joueur] )
)
)
)Table 3 =
SUMMARIZE (
'Table 2',
'Table 2'[Position],
"AUG",
CALCULATE (
AVERAGE ( 'Table 2'[AUG] ),
FILTER ( 'Table 2', 'Table 2'[Position] = EARLIER ( 'Table 2'[Position] ) )
)
)
The result is:
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @maxduff59 ,
You can try this method:
Table =
SUMMARIZE (
'Stats_Activités',
'Stats_Activités'[Year_Week],
'Stats_Activités'[Position],
'Stats_Activités'[Joueur],
"SUM",
CALCULATE (
SUM ( 'Stats_Activités'[Distance] ),
FILTER (
'Stats_Activités',
'Stats_Activités'[Position] = EARLIER ( 'Stats_Activités'[Position] )
&& 'Stats_Activités'[Year_Week] = EARLIER ( 'Stats_Activités'[Year_Week] )
)
)
)Table 2 =
SUMMARIZE (
'Table',
'Table'[Position],
'Table'[Joueur],
"AUG",
CALCULATE (
AVERAGE ( 'Table'[SUM] ),
FILTER (
'Table',
'Table'[Position] = EARLIER ( 'Table'[Position] )
&& 'Table'[Joueur] = EARLIER ( 'Table'[Joueur] )
)
)
)Table 3 =
SUMMARIZE (
'Table 2',
'Table 2'[Position],
"AUG",
CALCULATE (
AVERAGE ( 'Table 2'[AUG] ),
FILTER ( 'Table 2', 'Table 2'[Position] = EARLIER ( 'Table 2'[Position] ) )
)
)
The result is:
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot. It seems great.
I just had a little question about the use of EARLIER function in the filter, why do you use that function ?
Hi @maxduff59 ,
This function is used to be able to get the context of the same position.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@maxduff59 , The measure seem correct to me, It will avg other than week position
may be you need
Moyenne Semaine =
AVERAGEX(
SUMMARIZE('Stats_Activités'
, 'Stats_Activités'[Year_Week]
, "Distance courue", SUM('Stats_Activités'[total_distance_courue_(m)])
),[Distance courue])
or Switch that is based on isfiltered or isinscope
IsInScope - Switch Rank at different levels: https://youtu.be/kh0gezKICEM
HasOneValue , Isfiltered: https://www.youtube.com/watch?v=hXg3kRFSGjA&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=38
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 18 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 38 | |
| 31 | |
| 27 |