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. 🙂
Cynthia
4 years agoRegular Visitor
Hi littlemojopuppy ,
it worked! Thank you so much. I have accepted as solution.
Kind regards,
Cynthia
littlemojopuppy
4 years agoCommunity Champion
Hi Cynthia all I did in the pbix was implement the suggestion I offered with creating date table, converting your text fields to actual dates, etc. That was the real solution 🙂 I marked that as the solution.
- Cynthia4 years agoRegular Visitor
Thank you very much littlemojopuppy
- littlemojopuppy4 years agoCommunity Champion
Cynthia you're welcome. Glad I could help!