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
AstridM
Frequent Visitor

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
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