Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Counting value changes in given time period

Hi everyone,    I am pretty new to PowerBI, and need some help. Here is some information regarding the problem that I am unsure how to approach.   Data Source: SharePoint Online List What do I w...
  • v-xulin-mstf's avatar
    v-xulin-mstf
    5 years ago

    Hi Anonymous

     

    In the absence of your sample data, maybe you can measure like:

    Measure = 
    var this_week=
    CALCULATE(
        SUM([values]),
        FILTER(
            'Table',
            'Table'[Date]=thisweek  //  return date of this week
    ))
    var Last_week=
    CALCULATE(
        SUM([values]),
        FILTER(
            'Table',
            'Table'[Date]=thisweeek-7 // return date of last week
    ))
    return
    IF(
        this_week-Last_week>0,
        CONCATENATE("+",this_week-Last_week),
        this_week-Last_week
    )

     

    Best Regards,

    Link