Forum Discussion
Comparison of previous years average with current months average in the bar graph
- 5 years ago
Hi mokhan ,
Based on your description, you can create a calulated column like this to use it as X-axis:
Axis = IF ( YEAR ( 'Table'[Date] ) = YEAR ( TODAY () ), 'Table'[Date].[Month], CONVERT ( YEAR ( 'Table'[Date] ), STRING ) )Then create these to measures, one of them calculates average about each year and each month for current year, another one calulates average about all years as a target:
Avg = AVERAGE('Table'[Values]) Avg_allyears = CALCULATE ( AVERAGE ( 'Table'[Values] ), ALL ( 'Table' ) )Use a 'Line and stacked column chart ' to show it:
Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mokhan ,
Based on your description, you can create a calulated column like this to use it as X-axis:
Axis =
IF (
YEAR ( 'Table'[Date] ) = YEAR ( TODAY () ),
'Table'[Date].[Month],
CONVERT ( YEAR ( 'Table'[Date] ), STRING )
)
Then create these to measures, one of them calculates average about each year and each month for current year, another one calulates average about all years as a target:
Avg = AVERAGE('Table'[Values])
Avg_allyears =
CALCULATE ( AVERAGE ( 'Table'[Values] ), ALL ( 'Table' ) )
Use a 'Line and stacked column chart ' to show it:
Attached a sample file in the below, hopes to help you.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.