Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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
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!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 8 | |
| 8 |