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.
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 filter. I have tried with previousmonth function, but I do not get the desired value.
Thanks for your help.
Solved! Go to Solution.
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]) ) )
Hello 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.
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]) ) )
Amazing. Works perfectly. Thanks for your great 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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |