Forum Discussion
Running Total with Blank Month Value
- 4 years ago
Hi,
Thank you for your feedback.
Please check the below if it suits your requirement.
-Jun value shows in the table visualization
-only upto Nov values are shown.
Cumulative = VAR _lastdateinscheduletable = CALCULATE ( MAX ( Schedule[Forecasted Date] ), REMOVEFILTERS () ) RETURN CALCULATE ( SUM ( 'Schedule'[Forecast] ), USERELATIONSHIP ( CalendarM[Date], 'Schedule'[Forecasted Date] ), FILTER ( ALLSELECTED ( 'CalendarM' ), CalendarM[Date] <= MAX ( CalendarM[Date] ) && CalendarM[Year] = MAX ( CalendarM[Year] ) && MIN ( CalendarM[Date] ) <= _lastdateinscheduletable ) )
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Cumulative =
CALCULATE (
SUM ( 'Schedule'[Forecast] ),
USERELATIONSHIP ( CalendarM[Date], 'Schedule'[Forecasted Date] ),
FILTER (
ALLSELECTED ( 'CalendarM' ),
CalendarM[Date] <= MAX ( CalendarM[Date] )
&& CalendarM[Year] = MAX ( CalendarM[Year] )
)
)
For example, in the schedule table, 7if we don't have any June dates in the Forecasted Date, how can we calculate a culmulative value without skipping June?
Forecasted DateForecast
| Sunday, 1 May 2022 | 5 |
| Friday, 1 July 2022 | 3 |
| Monday, 1 August 2022 | 4 |
| Thursday, 1 September 2022 | 7 |
| Saturday, 1 October 2022 | 6 |
| Tuesday, 1 November 2022 | 9 |
- Jihwan_Kim4 years ago
Super User
Hi,
Thank you for your feedback.
Please check the below if it suits your requirement.
-Jun value shows in the table visualization
-only upto Nov values are shown.
Cumulative = VAR _lastdateinscheduletable = CALCULATE ( MAX ( Schedule[Forecasted Date] ), REMOVEFILTERS () ) RETURN CALCULATE ( SUM ( 'Schedule'[Forecast] ), USERELATIONSHIP ( CalendarM[Date], 'Schedule'[Forecasted Date] ), FILTER ( ALLSELECTED ( 'CalendarM' ), CalendarM[Date] <= MAX ( CalendarM[Date] ) && CalendarM[Year] = MAX ( CalendarM[Year] ) && MIN ( CalendarM[Date] ) <= _lastdateinscheduletable ) )- ElenaJ4 years agoFrequent Visitor
It worked! Amazing!
Many thanks for your help!
- haoqiong552 years agoRegular Visitor
This answer has helped resolve my question too. Much appreciated! Now I'm trying to get a new measure for calculating the running total of previous year in same way. Could you provide some guidance? Thank you