Forum Discussion
Average YTD Calculation Based on User Selection
- 6 years ago
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.
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:
- Period 1 is 435.34
- Period 2 is 444.54
- Period 3 is 433.27
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):
- Period 1=435.34
- Period 2=439.94
- Period 3=437.72
But I'm getting:
- Period 1=435 (correct value)
- Period 2=222 (incorrect value)
- Period 3=144 (incorrect value)
I hope that's clear.
- PowerBI-Newbie6 years agoHelper IV
Hi Icey ,
Did you an opportunity to have a look at my query from my last post?