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

Measure to compute changes within same table

Hi All,

 

Would like to seek for some help here. 

I have a series of weekly file with information similar to below table:

 

Unique KeyWeek numberQuarterly Forecast
A01184
A02154
B011135
C011251
A012107
B012326
B022181
C022393
A013247
A023385
B013395
C023113

 

Can I create a measure to compute the difference of the same Primary (current week vs last week)?

For example, during week 4, what shown under Unique Key A01 will be the change from week 3 to week 4.

 

Appreciate your help here.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Measure to compute changes within same table

Hi,

 

You may download my PBI file from here.

 

Hope this helps.

5 REPLIES 5
Highlighted
Super User
Super User

Re: Measure to compute changes within same table

Hi,

 

Your question is not clear.  Show the expected result.

StevenTeyWJ Frequent Visitor
Frequent Visitor

Re: Measure to compute changes within same table

Hi Ahish,

 

Thanks for replying. What I expected is:

 

Data Table (consists of series of weekly data)

Primary KeyWeekValue
A011120
A012170
A01370
A014100
A02170
A022100
A023170
A024130

 

Outcome:

 

Primary KeyWeek 2Week 3Week 4
A0150-10030
A023070-40

Week 2 = Difference in vallue for A01/A02 between Week 2 and Week 1 (Previous Week)

Week 3 = Difference in vallue for A01/A02 between Week 3 and Week 2 (Previous Week)

 

So I can plot either column chart or line chart to visualize the changes every week.

Thanks for your help.

Super User
Super User

Re: Measure to compute changes within same table

Hi,

 

You may download my PBI file from here.

 

Hope this helps.

StevenTeyWJ Frequent Visitor
Frequent Visitor

Re: Measure to compute changes within same table

Thanks Ashish! It defintely helps here!

The only change I made is the week formula:

Previous formula makes it repeating from 1 to 4.

 

Week = QUOTIENT(
DATEDIFF(DATE(YEAR('Calendar Date'[Date]),1,1),'Calendar Date'[Date], DAY) +1
,7)
 
Thanks for your assistance here!
Super User
Super User

Re: Measure to compute changes within same table

You are welcome.