Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi PowerBi'ers!!
Nearly Chrismas 🙂
I have one for you all, which im sure is simple, but I've been trying different solutions ive seen on here and youtube, but it doesnt calculate right.
Scenario: x1 calculation column IW-MFR basically sums "IW-Faulty" and divides by "Cumulative Shipment" for each row
Aim: Create another column with a sum for rolling 12 months (sum the current row and the previous 11 rows) - This can be in Powrquery or a DAX column.
I have this in excel which is simple and is literally Sum previous current and previous 11 months:
This would make my Christmas if this could be solved!!! 🙂
Cheers Guys!!
Can anyone help me please? 🙂
SUM 12month =
VAR Total =
CALCULATE (
[Total ListPrice],
DATESINPERIOD ( 'Date'[Date], [LastCurrentDate], -12, MONTH )
)
RETURN
Total
******************************************************
Hi Mahesh
I have tried applying this in M Code in PQ and in Dax Table column, but i get varying errors:
Can you explain a bit more please?
Hi @rhawlor ,
You can not use in M Code it is use only Power bi desktop DAX Measure.
Thanks, ok that will be why it isnt working, I need a column added to the data, can you still help? 🙂
calculated column is useful for you instead of add column in data.
Yes i have tried that in New Column in DAX, but it just throws an error similar to the baove ones.
You can create a calculated column:
Column = CALCULATE(SUM('Table3'[Value]),FILTER('Table3','Table3'[Date]<=EARLIER('Table3'[Date])))
Hi Mahesh
Thanks for the above, how do i incorporate the above to use only the previous 12 rows?