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
Atinder
Helper III
Helper III

Compare monthly sales with average sales of last 90 days from that month

Hello all, 

 

I want to create a report that shows sales growth up and down for each item compare with average of last 90 days or 3 months from that month. show me growth rate by %. 

Atinder_0-1661609027702.png

Below is the example I want to achieve in the powerbi report. Automatically do the math and give %. 

 

Item_NoJanuaryFEBMARCHAPRILMAY
Apple500600300200250
Calculations (600-500)/500 =20%1. (500+600)/2 =550   2. (300-550)/550  =-45%                 1. (500+600+300)/3 = 466.7                    2.(200-466.7)/466.7 = -57%

1. (600+300+200)/3=275                    

  2. (250-275)/275= -9%

Sales Growth 20%-45%-57%-9%

 

1. Is it possible to days?

2. is there any another way to achieve this result?

 

Thank you,

Paul

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi @Atinder ,

 

You can try the following methods.

Cumulative 3 month = 
Var N1=SUMMARIZE(FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])),[Date],"Sum",SUM('Table'[Sales]))
Var N2=TOPN(3,N1,[Date],DESC)
Var Cumulative3month=SUMX(N2,[Sum])
return
Cumulative3month
Count = 
Var N1=CALCULATE(COUNT('Table'[Date]),FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])))
Return
IF(N1<=3,N1,3)
Sales Growth = 
Var N1=DIVIDE([Cumulative 3 month],[Count])
return
DIVIDE(SUM('Table'[Sales])-N1,N1)

vzhangti_0-1661844601125.pngvzhangti_1-1661844620184.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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-zhangti
Community Support
Community Support

Hi @Atinder ,

 

You can try the following methods.

Cumulative 3 month = 
Var N1=SUMMARIZE(FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])),[Date],"Sum",SUM('Table'[Sales]))
Var N2=TOPN(3,N1,[Date],DESC)
Var Cumulative3month=SUMX(N2,[Sum])
return
Cumulative3month
Count = 
Var N1=CALCULATE(COUNT('Table'[Date]),FILTER(ALL('Table'),[Date]<SELECTEDVALUE('Table'[Date])))
Return
IF(N1<=3,N1,3)
Sales Growth = 
Var N1=DIVIDE([Cumulative 3 month],[Count])
return
DIVIDE(SUM('Table'[Sales])-N1,N1)

vzhangti_0-1661844601125.pngvzhangti_1-1661844620184.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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.

Top Solution Authors
Top Kudoed Authors