Forum Discussion
Cynthia
4 years agoRegular Visitor
difference between data _ months in same column
Hi, In powerBI desktop I am preparing a report in which i need compare the difference month by month. in my source data the month are in the same column, so I can't use simple difference function. t...
- 4 years ago
Hi Cynthia. In order for this to work, you need to do three things first:
- Make sure your data model has a date table and that it is marked as one
- Convert your values of "Jan 21", "oct 21", etc. to actual date values. Go with month ending values.
- Create a relationship between the date field in the date table and the date field in your data.
After you do those things, create measures like the following
Current Month = SUM([Value]) Prior Month = CALCULATE( [Current Month] PREVIOUSMONTH([Use the name of the date column from the date table]) ) MTM Difference = [Current Month] - [Prior Month]Hope this helps!
- 4 years ago
Hi Cynthia
I created the solution for you. Follow the logic in the attached pbix. Let me know if you have any questions. 🙂
v-henryk-mstf
4 years agoCommunity Support
Hi Cynthia ,
If you want to create formulas based on measure, the solution provided by littlemojopuppy works. If there are still problems, please point it out.
Looking forward to your feedback.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cynthia
4 years agoRegular Visitor
Thank you very much v-henryk-mstf .