Forum Discussion

Cynthia's avatar
Cynthia
Regular Visitor
4 years ago
Solved

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...
  • littlemojopuppy's avatar
    4 years ago

    Hi Cynthia.  In order for this to work, you need to do three things first:

    1. Make sure your data model has a date table and that it is marked as one
    2. Convert your values of "Jan 21", "oct 21", etc. to actual date values.  Go with month ending values.
    3. 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!

  • littlemojopuppy's avatar
    littlemojopuppy
    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.  ğŸ™‚