Forum Discussion

qwaiti27231's avatar
qwaiti27231
Icon for Helper III rankHelper III
6 years ago

30 days count

for eg today is 26/10/2020

i want to the count of users 

for last days 30 days in for each day 

eg 

25/9/2020-25/10/2020-482 

24/9/2020-24/10/2020-442

23/9/2020-23/10/2020-342

5 Replies

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        qwaiti27231 , if you have a date in your table or join the date with your date table and use that. Both solution I suggested should give you trend.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi qwaiti27231 

    Due to I don't know your data model, I build a sample to have a test.

    I think you may build a measure to calculate the running total in last 30 days for per day.

    My Sample has Date column(2020/09/01 to 2020/10/28) and a value column.

    My Measure:

     

    Measure = 
    VAR _PerDay =
        MAX ( Sheet2[Date] )
    VAR _Last30Days =
        MAX ( Sheet2[Date] ) - 30
    VAR _Sum30days =
        SUMX (
            FILTER (
                ALL ( Sheet2 ),
                Sheet2[Date] <= _PerDay
                    && Sheet2[Date] >= _Last30Days
            ),
            Sheet2[Value]
        )
    RETURN
        _Sum30days

     

    Result:

    You can download the pbix file from this link: 30 days count

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.