cancel
Showing results for
Search instead for
Did you mean:
phanimusunuri9 Frequent Visitor

## Week over Week Comparison

Hi All,

I am trying to compare "Monday Last week's Sales" with "Monday this week's Sales". To be precise, if today is 'Monday' i want to compare it with last 'Monday', if 'Tuesday then last week 'Tuesday'. so on..

Sales last Monday = 2,450

Sales this Monday = 2,360

Difrerence = 90 (3.6%)

Is there a way to do this as a 'Measure', i want this in KPI visual.

1 ACCEPTED SOLUTION

Accepted Solutions v-sihou-msft
Moderator

## Re: Week to Week Comparison - Measure

@phanimusunuri9

You should have Year, Week Number and Weekday columns in your table. Or you can generate with calculated column.

`WeekNumber = WEEKNUM(Table[Date],2)`
`WeekDay = WEEKDAY(Table[Date],2)`

Then you can create a measure like:

```Difference =
SUM ( Table[Sales] )
- CALCULATE (
SUM ( Table[Sales] ),
FILTER (
ALL ( Table ),
Table[Year] = MAX ( Table[Year] )
&& Table[WeekNumber]
= MAX ( Table[WeekNumber] ) - 1
&& Table[WeekDay] = MAX ( Table[WeekDay] )
)
)
```

Regards,

3 REPLIES 3
phanimusunuri9 Frequent Visitor

## Week to Week Comparison - Measure

Hi All,

I am trying to compare "Monday Last week's Sales" with "Monday this week's Sales". To be precise, if today is 'Monday' i want to compare it with last 'Monday', if 'Tuesday then last week 'Tuesday'. so on..

Sales last Monday = 2,450

Sales this Monday = 2,360

Difrerence = 90 (3.6%)

Is there a way to do this as a 'Measure', i want this in KPI visual. Super User

## Re: Week over Week Comparison

Hi,

Share a snapshot of your data. v-sihou-msft
Moderator

## Re: Week to Week Comparison - Measure

@phanimusunuri9

You should have Year, Week Number and Weekday columns in your table. Or you can generate with calculated column.

`WeekNumber = WEEKNUM(Table[Date],2)`
`WeekDay = WEEKDAY(Table[Date],2)`

Then you can create a measure like:

```Difference =
SUM ( Table[Sales] )
- CALCULATE (
SUM ( Table[Sales] ),
FILTER (
ALL ( Table ),
Table[Year] = MAX ( Table[Year] )
&& Table[WeekNumber]
= MAX ( Table[WeekNumber] ) - 1
&& Table[WeekDay] = MAX ( Table[WeekDay] )
)
)
```

Regards,