Hello All,
I have the below code and it works fine apart from the fact that the most recent month and first month in the range are not giving me the result I want.
In the example below my data does not have data for September 2022, so I am not sure why this is showing in the table.
Below is split into two tables, 1st table are what I get now and the 2nd table is my desired results.
Hoping someone can assist, as it's only my 5th day using power bi.
Current Results
Desired Results
I have the below code and it works fine apart from the fact that the most recent month and first month in the range are not giving me the result I want.
In the example below my data does not have data for September 2022, so I am not sure why this is showing in the table.
Below is split into two tables, 1st table are what I get now and the 2nd table is my desired results.
Hoping someone can assist, as it's only my 5th day using power bi.
Current Results
Year | Month | COUNT_ACT | Last Month Difference |
2022 | September | 10,000 | |
2022 | August | 10,000 | - 1,000 |
2022 | July | 11,000 | - 1,000 |
2022 | June | 12,000 | 4,000 |
2022 | May | 8,000 | 8,000 |
Desired Results
Year | Month | COUNT_ACT | Last Month Difference |
2022 | September | ||
2022 | August | 10,000 | - 1,000 |
2022 | July | 11,000 | - 1,000 |
2022 | June | 12,000 | 4,000 |
2022 | May | 8,000 |
Excel Formula:
Last Month Difference = sum( Dataset[COUNT_ACT])-CALCULATE(sum( Dataset[COUNT_ACT]),PREVIOUSMONTH( Dataset[ReportingMonth].[Date]))