cancel
Showing results for
Did you mean:
Helper II

## Difference in previous week

i have a table with a total snapshot on friday e.g 100. what dax would i need to show the increase or decrease from previous friday.

1 ACCEPTED SOLUTION
Solution Supplier

Hello there @NewbieJono ! Imagining you are adding up the values for a column the Dax would be as follows:

``````Total_value =
CALCULATE(
SUM(Table[Column]),
)``````

If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

5 REPLIES 5
Solution Sage

Try this ...

Variance % =

VAR salesthisweek =
SUM(Query[Sale])

VAR salespreviousweek =
CALCULATE(SUM(Query[Sale]),
)

RETURN
DIVIDE(salespreviousweek , salesthisweek)

Resolver II

You can add Relative Week column into your date table and calculate total snapshot for last week and current week then the difference between both weeks.

For Relative Week add following columns to date table:

``````StartOfWeek = DimDate[Date] - WEEKDAY(DimDate[Date],2) + 1

StartOfCurrentWeek = TODAY() - WEEKDAY(TODAY(),2) + 1

RelativeWeek = (DimDate[StartOfWeek] - DimDate[StartOfCurrentWeek])/7``````

Now can create a measure to calculate weekly difference:

WoW DIff =

``````WoW diff =
VAR past_week =
CALCULATE( [Total Cost], 'Date'[Relative Week] = -1 )
VAR cur_week =
CALCULATE( [Total Cost], 'Date'[Relative Week] = 0 )
RETURN
cur_week - past_week``````

Solution Supplier

Hello there @NewbieJono ! Imagining you are adding up the values for a column the Dax would be as follows:

``````Total_value =
CALCULATE(
SUM(Table[Column]),
)``````

If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Helper II

this is working thank you, how could i expand this to show % change ?

Solution Supplier

Hello there @NewbieJono ! You can do it like so:

`````` % Change =

var _current = SUM(Table[Column])

var _previous =
CALCULATE( SUM( Table[Column] ),
)

var _diff = _current - _previous

RETURN
DIVIDE(_diff, _previous) ``````

And then format the value as a "%" in the "Format" ribbon!

If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Announcements

#### Launching new user group features

Learn how to create your own user groups today!