Forum Discussion
Redistributing a calculation across date range
- 6 years ago
Hi CEllinger
Add three measures
Measure = SUMX(ALLEXCEPT('date','date'[year]),[selected value]) Measure 2 = CALCULATE ( DISTINCTCOUNT ( 'date'[year monthno] ), FILTER ( ALLSELECTED ( 'date' ), 'date'[year] = MAX ( 'date'[year] ) && 'date'[Date] > EOMONTH ( MAX ( 'disconnect date'[Date] ), 0 ) ) ) Measure 3 = [Measure]/[Measure 2] Measure 4 = IF ( MAX ( 'date'[Date] ) > EOMONTH ( MAX ( 'disconnect date'[Date] ), 0 ), [rest of the year] + [Measure 3] )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi CEllinger
Is this expected?
If it is ok, please see my steps below:
Create a date table without relationship
Add [date] column to a slicer from this "disconnect date" table.
Create measures
selected value =
CALCULATE (
SUM ( 'Table'[order] ),
FILTER (
'Table',
'Table'[date]
>= MIN ( 'disconnect date'[Date] )
&& 'Table'[date]
<= MAX ( 'disconnect date'[Date] )
)
)
all rest valuue =
CALCULATE (
SUM ( 'Table'[order] ),
FILTER (
'Table',
'Table'[date]
< MIN ( 'disconnect date'[Date] )
|| 'Table'[date]
> MAX ( 'disconnect date'[Date] )
)
)
rest of the year =
CALCULATE (
SUM ( 'Table'[order] ),
FILTER (
'Table',
'Table'[date]
> MAX ( 'disconnect date'[Date] )
&& YEAR ( 'Table'[date] )
= YEAR (
MAX ( 'disconnect date'[Date] )
)
)
)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for replying v-juanli-msft !
I have been able to replicate that so far on my own. What I am trying to do is (from your model) take the 'All Selected Value" and spread it evenly across the "Rest of the Year."
So rest of the year should be
| Order | Selected | All Rest | Rest of Year | Desired Rest of Year |
1
| 1 | |||
| 2 | 2 | |||
| 3 | 3 | |||
| 4 | 4 | |||
| 5 | 5 | |||
| 6 | 6 | |||
| 7 | 7 | |||
| 8 | 8 | |||
| 9 | 9 | |||
| 10 | 10 | 10 | 10 +13 | |
| 1 | 1 | 1 | 1+13 | |
| 2 | 2 | 2 | 2+13 |
So the SUM(Selected) moved to the Date Range of (Rest of Year).
Is that more clear?
- v-juanli-msft6 years agoCommunity Support
Hi CEllinger
Add three measures
Measure = SUMX(ALLEXCEPT('date','date'[year]),[selected value]) Measure 2 = CALCULATE ( DISTINCTCOUNT ( 'date'[year monthno] ), FILTER ( ALLSELECTED ( 'date' ), 'date'[year] = MAX ( 'date'[year] ) && 'date'[Date] > EOMONTH ( MAX ( 'disconnect date'[Date] ), 0 ) ) ) Measure 3 = [Measure]/[Measure 2] Measure 4 = IF ( MAX ( 'date'[Date] ) > EOMONTH ( MAX ( 'disconnect date'[Date] ), 0 ), [rest of the year] + [Measure 3] )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- CEllinger6 years agoHelper I