cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Uzi2019
Power Participant
Power Participant

Help with WoW result

Hi Community,
I need to calculate prev week spend which I tried from my end but at the measure total getting wrong result. Attaching sample data and screen shot below.  Any help would be highlighly appreciated.

Spend

Week

Date

Expected Result

120

1

01-Jan-23

 

130

2

02-Jan-23

120

150

2

03-Jan-23

130

120

2

04-Jan-23

150

110

2

05-Jan-23

120

90

2

06-Jan-23

110

56

2

07-Jan-23

90

58

2

08-Jan-23

56

36

3

09-Jan-23

58

90

3

10-Jan-23

36

120

40

01-Oct-22

0

230

40

02-Oct-22

120

220

41

03-Oct-22

230

100

41

04-Oct-22

220

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
1 ACCEPTED SOLUTION
serpiva64
Super User
Super User

Hi,

you need to add a Year column in your Table

Year = YEAR('Table'[Date])
then you can use offset
Measure = CALCULATE(Sum('Table'[Spend]),OFFSET(-1,ORDERBY('Table'[Date],DESC),,PARTITIONBY('Table'[Year])))

 

serpiva64_1-1676028744284.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

 

View solution in original post

2 REPLIES 2
serpiva64
Super User
Super User

Hi,

you need to add a Year column in your Table

Year = YEAR('Table'[Date])
then you can use offset
Measure = CALCULATE(Sum('Table'[Spend]),OFFSET(-1,ORDERBY('Table'[Date],DESC),,PARTITIONBY('Table'[Year])))

 

serpiva64_1-1676028744284.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

 

@serpiva64  Thanks a ton! you saved me again 😊

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors