Forum Discussion

JoaoTrindade's avatar
JoaoTrindade
Frequent Visitor
7 years ago
Solved

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...
  • parry2k's avatar
    parry2k
    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.