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
pwrbiadm
Helper I
Helper I

Calculated Column for Previous Quarter Sales by Customer

Hello,

 

I have 2 input tables - Customer Details and Order Details. I have to calculate Previous Quarter Sales for a particular Customer which should not change based on Product or Date filters. Please help me with calculating values of V, W, X, Y & Z. Thanks!

 

Input Table 
Customer NamePrev Qtr Sales
AV
BW
CX
DY
EZ

 

Input Table   
Customer NameOrder DateProduct Sales 
A1/29/2019G $     990
B1/23/2019H $     195
C1/23/2019I $     100
D1/23/2019G $     200
E1/23/2019H $     495
A1/23/2019I $     450
B1/16/2019G $     195
C1/16/2019H $     495
D1/16/2019I $     495
E1/16/2019G $     150
A1/16/2019H $     450
B1/9/2019I $     300
C1/9/2019G $     180
D1/9/2019H $     495
E1/9/2019I $     195
A1/4/2019G $     990
B12/19/2018H $     150
C12/20/2018I $     195
D12/19/2018G $     990
E12/19/2018H $     495
A12/7/2018I $     990
B11/29/2018G $     495
C11/29/2018H $     495
D11/20/2018I $     990
E11/12/2018G $     990
A11/7/2018H $     990
B11/7/2018I $     150
C10/29/2018G $     150
D10/29/2018H $     495
E10/22/2018I $     495
A10/22/2018G $     495
B10/18/2018H $     495
C10/18/2018I $     450
D10/5/2018G $     600
E9/25/2018H $     300
A10/5/2018I $     495
B10/5/2018G $     450
C10/5/2018H $     300
D10/5/2018I $     300
E9/20/2018G $     300
A9/19/2018H $     600
B9/25/2018I $     990
C9/25/2018G $     300
D9/20/2018H $     990
E9/20/2018I $     450
A9/14/2018G $     450
B9/11/2018H $     990
C9/11/2018I $     495
D9/11/2018G $     150
E8/27/2018H $     450
A8/27/2018I $  1,485
B8/21/2018G $     225
C8/16/2018H $     300
D8/10/2018I $  1,485
E8/10/2018G $     150
A8/10/2018H $     150
B8/2/2018I $     495
C8/2/2018G $     495
D8/2/2018H $     450
E7/17/2018I $     990
A7/17/2018G $     150
B7/17/2018H $     272
C7/3/2018I $     150
D7/2/2018G $     990
E7/2/2018H $     105
A7/2/2018I $     272
B6/10/2018G $     225
C5/22/2018H $     225
D6/10/2018I $     990
E6/10/2018G $     495
A6/10/2018H $     272
B5/31/2018I $     495
C5/31/2018G $     105
D5/31/2018H $        30
E5/31/2018I $     495
A5/22/2018G $     272
B5/25/2018H $     150
C5/22/2018I $     210
D5/22/2018G $     495
E5/22/2018H $     225
A5/22/2018I $     300
B5/8/2018G $     225
C5/13/2018H $     272
D5/8/2018I $     272
E5/3/2018G $     544
A5/13/2018H $     990
B5/13/2018I $     495
C5/3/2018G $     210
D5/3/2018H $        83
E5/3/2018I $        83
A5/3/2018G $     165
B5/3/2018H $     165
C5/3/2018I $        50
D5/3/2018G $        25
E5/3/2018H $        75
A4/24/2018I $     495
B4/24/2018G $     150
C4/3/2018H $     544
D4/3/2018I $     105
E4/3/2018G $     990
A4/3/2018H $     495
B4/3/2018I $     150
C3/6/2018G $     990
D3/6/2018H $     495
E3/6/2018I $     150
A2/22/2018G $     150
B2/22/2018H $     300
C2/16/2018I $     495
D2/16/2018G $     544
E2/16/2018H $     544
A2/9/2018I $     990
B2/9/2018G $     150
C1/30/2018H $     495
D1/30/2018I $     150
E1/30/2018G $     150
A1/30/2018H $     272
B1/30/2018I $     272
C11/23/2017G $     150
D11/15/2017H $     495
E11/6/2017I $     150
A10/5/2017G $     150

 

Output Table  
Customer NameProductPrev Qtr Sales
AGV
BHW
CIX
DGY
EHZ
AIV
BGW
CHX
DIY
EGZ
AHV
BIW
CGX
DHY
EIZ
1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@pwrbiadm,

 

Try using CALCULATE Function to change the context.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@pwrbiadm,

 

Try using CALCULATE Function to change the context.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.