Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.