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 have the following data:
I am able to filter out by each year and period and the correct YTD figure displays thanks to help from Power BI Superusers:
I now want to change the YTD from being running total to average depending on the user selection.
So the following is the intention when the user selects the relevant Period for a particular year:
| Year | Period | Average Planned YTD |
| 19-20 | 1 | 9 |
| 19-20 | 2 | =(9+16)/2 =12.5 |
| 19-20 | 3 | =(9+16+15)/3=13.3 |
| 19-20 | 4 | =(9+16+15+14)/4=13.5 |
Please note that the Year and Period slicers are already related to the Period and YTD tables, that's how I've managed to get the right figures for Period and YTD.
Any help is greatly appreciated.
Solved! Go to Solution.
Hi @PowerBI-Newbie ,
How about this:
Average Planned YTD =
VAR SelectedPeriod =
SELECTEDVALUE ( 'Table'[Period] )
VAR MaxPeriod =
MAX ( 'Table'[Period] )
RETURN
IF (
SelectedPeriod = BLANK (),
[Planned (YTD)] / MaxPeriod,
[Planned (YTD)] / SelectedPeriod
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @PowerBI-Newbie ,
Try this:
Average Planned YTD = CALCULATE ( AVERAGE ( 'Table'[Planned] ), ALLSELECTED ( 'Table'[Period] ) )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your response @Icey but I need the user to select only one period at a time from the slicer and when they do then the correct value is displayed. If they select more than one then the correct averages are displayed for each period. Your images show the incorrect YTD averages for other periods when more than one selection is made - in your example, when you select more than one period the average is displaying the same.
If you look at my table in my post, the user selects only Period 1, average YTD 9 is displayed. User selects only Period 2 then 12.5 is displayed. If user selects Period 1 and 2 then 9 is displayed for Period 1 and 12.5 for Period 2.
I hope that makes sense.
Hi @PowerBI-Newbie ,
How about this:
Average Planned YTD =
VAR SelectedPeriod =
SELECTEDVALUE ( 'Table'[Period] )
VAR MaxPeriod =
MAX ( 'Table'[Period] )
RETURN
IF (
SelectedPeriod = BLANK (),
[Planned (YTD)] / MaxPeriod,
[Planned (YTD)] / SelectedPeriod
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Icey ,
Thank you for your response. Your solution worked for a lot of my KPIs apart from one. The data is as follows:
| Period | Area | Allocation |
| 1 | A | 195.03 |
| 1 | B | 266.81 |
| 2 | A | 201.86 |
| 2 | B | 269.18 |
| 3 | A | 200.23 |
| 3 | B | 259.54 |
I'm calculating the sum of Areas A & B but subtract 26.5 so total for:
The averages should then read:
My Periodic Measure is:
What do the numbers in the screenshots you provide represent? And how is it calculated?
Best Regards,
Icey
Hi @Icey ,
Apologies for not being clear. The set of numbers on the left side represent the periodic figures for certain KPIs while the right side represent the YTD. What we're focused on is the first figure on the left and right (435) which represents the Allocation KPI.
The left-side figures (periodic) for Allocation are calculated using the following measure:
It's calculating the sum of Areas A & B minus 26.5:
The data is from the following table:
| Period | Area | Allocation |
| 1 | A | 195.03 |
| 1 | B | 266.81 |
| 2 | A | 201.86 |
| 2 | B | 269.18 |
| 3 | A | 200.23 |
| 3 | B | 259.54 |
The right-side figures (average YTD) for Allocation are calculated using the following measure (which you gave me):
But I'm getting:
I hope that's clear.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 20 | |
| 18 |