cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daven
Helper II
Helper II

Previous Fiscal Quarter value

Hi, 

 

I need help adding a column. I have the below columns and need to add a new column that will show the Previous Quarter Value. 

 

I do not have date or month columns in the dataset. 

 

Fiscal Year      Fiscal Quarter         Current Quarter value               Previous Quarter Value (New column)  
2020        1      200           0
2020        2      180          200
2020        3      136          180
2020       4      120          136
2021       1      490          120
2021       2      230          490

 

Thanks in advance 

 

Daven

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Daven 

is this what you want?

Column = 
VAR previous=maxx(FILTER('Table (3)','Table (3)'[Fiscalyear]=EARLIER('Table (3)'[Fiscalyear])&&'Table (3)'[fiscalquarter]=EARLIER('Table (3)'[fiscalquarter])-1),'Table (3)'[currentquartervalue])
VAR previous2=maxx(FILTER('Table (3)','Table (3)'[Fiscalyear]=EARLIER('Table (3)'[Fiscalyear])-1&&'Table (3)'[fiscalquarter]=4),'Table (3)'[currentquartervalue])
return if('Table (3)'[fiscalquarter]=1,previous2,previous)+0

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Jihwan_Kim
Super User
Super User

Hi, @Daven 

Please try the below.

 

Picture2.png

 

Previous Q Value CC =
VAR currentyear = 'Table'[Fiscal Year]
VAR currentquarter = 'Table'[Fiscal Quarter]
RETURN
IF (
currentquarter <> 1,
CALCULATE (
SUM ( 'Table'[Current Quarter value] ),
FILTER (
'Table',
'Table'[Fiscal Year] = currentyear
&& 'Table'[Fiscal Quarter] = currentquarter - 1
)
),
CALCULATE (
SUM ( 'Table'[Current Quarter value] ),
FILTER (
'Table',
'Table'[Fiscal Year] = currentyear - 1
&& 'Table'[Fiscal Quarter] = 4
)
)
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Daven,

Did these suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements to find it more quickly.

If these also not help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Jihwan_Kim
Super User
Super User

Hi, @Daven 

Please try the below.

 

Picture2.png

 

Previous Q Value CC =
VAR currentyear = 'Table'[Fiscal Year]
VAR currentquarter = 'Table'[Fiscal Quarter]
RETURN
IF (
currentquarter <> 1,
CALCULATE (
SUM ( 'Table'[Current Quarter value] ),
FILTER (
'Table',
'Table'[Fiscal Year] = currentyear
&& 'Table'[Fiscal Quarter] = currentquarter - 1
)
),
CALCULATE (
SUM ( 'Table'[Current Quarter value] ),
FILTER (
'Table',
'Table'[Fiscal Year] = currentyear - 1
&& 'Table'[Fiscal Quarter] = 4
)
)
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


ryan_mayu
Super User
Super User

@Daven 

is this what you want?

Column = 
VAR previous=maxx(FILTER('Table (3)','Table (3)'[Fiscalyear]=EARLIER('Table (3)'[Fiscalyear])&&'Table (3)'[fiscalquarter]=EARLIER('Table (3)'[fiscalquarter])-1),'Table (3)'[currentquartervalue])
VAR previous2=maxx(FILTER('Table (3)','Table (3)'[Fiscalyear]=EARLIER('Table (3)'[Fiscalyear])-1&&'Table (3)'[fiscalquarter]=4),'Table (3)'[currentquartervalue])
return if('Table (3)'[fiscalquarter]=1,previous2,previous)+0

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!