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.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
36 | |
33 | |
18 | |
18 |