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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AstridM
Advocate I
Advocate I

Help with a sigma formula

Hi,

 

I need to add the following formula to a table, but I am not sure how to get the sum of the last 6 months dynamically, not including this month..

 

My formula should be as follows =(2 * SUM("COST ON THE LAST 6 MONTHS")) / (SUM("ITEMS IN THE LAST 6 MONTH")/6)

 

The table is by day and it also has an item id.

 

Thanks! Astrid

2 REPLIES 2
Anonymous
Not applicable

You want a measure or a calc column?

Best
D
harshnathani
Community Champion
Community Champion

Hi @AstridM ,

 

 

 

Measure =

var 6Monthscost =  CALCULATE(SUM('Table'[cost]), DATESINPERIOD(Date[Date],ENDOFMONTH('Table'[Date]), -6, MONTH))

var 6Monthsitem =  CALCULATE(SUM('Table'[item]), DATESINPERIOD(Date[Date],ENDOFMONTH('Table'[Date]), -6, MONTH))

var div = DIVIDE( 6Monthsitem ,6)



RETURN



DIVIDE(2*6Monthscost , div)

 

 

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

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

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.