Forum Discussion
JoaoTrindade
7 years agoFrequent Visitor
cumulative by group
Hi, I'm trying to do a cumulative sum by group. I've tried different solutions but none seems to work. I have a table with millions of entries of booking made and they all are grouped by channel gr...
- 7 years ago
JoaoTrindade here is the measure
cumulative nights = CALCULATE( [total nights], FILTER( ALLSELECTED('gc_reports bookings'[book_date].[Date]), 'gc_reports bookings'[book_date].[Date] <= MAX ('gc_reports bookings'[book_date].[Date]) ) )also I noticed there is lot of both direction cross filter in your model whcih is a bad idea. anyhow that is seperate topic.
parry2k
Super User
7 years agoJoaoTrindade why you are sharing msi file?
JoaoTrindade
7 years agoFrequent Visitor
parry2k that goes to show you the state I'm in... :)
I selected the wrong file. Here it is
- parry2k7 years ago
Super User
JoaoTrindade here is the measure
cumulative nights = CALCULATE( [total nights], FILTER( ALLSELECTED('gc_reports bookings'[book_date].[Date]), 'gc_reports bookings'[book_date].[Date] <= MAX ('gc_reports bookings'[book_date].[Date]) ) )also I noticed there is lot of both direction cross filter in your model whcih is a bad idea. anyhow that is seperate topic.
- parry2k7 years ago
Super User
- JoaoTrindade7 years agoFrequent Visitor
Absolutely! What's the magic trick?
- JoaoTrindade7 years agoFrequent Visitor
parry2k Thanks a million Parry! This works to perfection.
- JoaoTrindade7 years agoFrequent Visitor
parry2k I was now looking in more detail at the data and the cumulative now it not accounting for the specific booking date selected. It is cumulating for all time. Why is that?