Forum Discussion
tulsi
Helper I
7 years agoMonth over Month Comparison from previous year
Hey, I have three columns in my dataset, month, task name and hours. I have to compare the % change of hours by task name month over month from last year. Can you help me with this. Thanks
- 7 years ago
tulsi ,
Click on the change column and click Modeling-> Format, change the format to percentage.
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yuta-msft
Community Support
7 years agotulsi ,
Generally, you can create a measure using DAX below:
Change =
VAR Current_Month =
MONTH ( Table[Date] )
VAR Previous_Month = Current_Month - 1
VAR Current_Month_Hours =
CALCULATE (
SUM ( Table[Hours] ),
FILTER ( Table, MONTH ( Table[Date] ) = Current_Month )
)
VAR Previous_Month_Hours =
CALCULATE (
SUM ( Table[Hours] ),
FILTER ( Table, MONTH ( Table[Date] ) = Previous_Month )
)
RETURN
IF (
YEAR ( Table[Date] )
>= YEAR ( TODAY () ) - 1,
Current_Month_Hours - Previous_Month_Hours / Previous_Month_Hours,
BLANK ()
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tulsi
Helper I
7 years agoThanks for the reply. Do I need to create a calendar table first? Sorry I'm new to powerBI. The date mentioned in the third line
MONTH ( Table[Date]
Is this from the calendar table?
Thanks