Forum Discussion
franpimed
7 years agoFrequent Visitor
Create new column with the previous period value
Hello, I'm new in power bi and I'm trying to create a new column that allows me to get the value of the previous month, but I have several columns in the data and I don“t know how to perform the fil...
- Anonymous7 years ago
You can use the following code to generate a new column:
Column = VAR __CurrentPeriod = Test[PERIOD D/M/YY] var __CurrentCountry = Test[COUNTRY] var __CurrentProduct = Test[PRODUCT] var __CurrentActivity = Test[ACTIVITY] RETURN CALCULATE( SUM( Test[CANTIDAD] ), FILTER( Test, Test[COUNTRY] = __CurrentCountry && Test[PRODUCT] = __CurrentProduct && Test[ACTIVITY] = __CurrentActivity && __CurrentPeriod = NEXTMONTH(Test[PERIOD D/M/YY]) ) )
UK06B1
Helper II
5 years agoHello I was trying to use the attached thread to solve a similar issue - i cannot get the previous month column to return the previous periods hours (week ending - are weekly periods - link to the week column). see screen shot below which has the formula + the table view.
Therefore for a given employee and a given time stamp and a given week - i would like to return the previous month value so that i can then see on a graph later the difference - or the monthly value - note my data is cumulative data.
The screen shot below shows the current formula i have -
Any help would be greatly appreciated.