Forum Discussion
remove date from context then do cumulative
Hi andyhere
create a date table which is not connected with your data table.
Create measures in your data table
max = MAX('calendar'[Date])
min = MIN('calendar'[Date])
meet dateperiond = IF(MAX(Sheet1[in_date])<=[min]&&MAX(Sheet1[out_date])>=[max],1,0)
If you mean "cumulative" by date( eg, cumulative sales from 2018/1/1 to 2018/10/1)
write this measure:
cml_asc_date =
CALCULATE (
SUM ( Sheet1[kw] ),
FILTER (
ALLSELECTED ( Sheet1 ),
[meet dateperiond] = 1
&& [in_date] <= MAX ( [in_date] )
)
)
If you mean "cumulative" grouped by different category
create a measure:
cml_by_item = CALCULATE(SUM(Sheet1[kw]),FILTER(Sheet1,[meet dateperiond]=1))
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 Maggie,
Thanks for your detailed response!
Why does the date/calendar table need to have no relationship to the data table? I would like to retain a relationship there for other graphs.
I tried making the first measure you suggested, but using ALLSELECTED I am unable to access the dates columns inside the filter, i guess because there is a relationship set up?
thanks,
Andy
- v-juanli-msft7 years agoCommunity Support
Hi andyhere
Please keep the calendar date table( i referred in my previous post) unconnected to your data table so that your problem here can be sloved.
To use date from a date table for other visuals, you could create another calendar date table and create relationships among this new calendar date table with your data tables.
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.