Forum Discussion
Return Current Year Only
- 4 years ago
Hi, bstark1287
You can try the following methods.
Column:Month = FORMAT([Date],"mmmm")Measure:
Current Year = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Calendar' ), [Month] = SELECTEDVALUE ( 'Calendar'[Month] ) && YEAR ( [Date] ) = YEAR ( TODAY () ) ) )Previous year = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Calendar' ), [Month] = SELECTEDVALUE ( 'Calendar'[Month] ) && YEAR ( [Date] ) = YEAR ( TODAY () ) - 1 ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bstark1287 you can easily use the relative date filter to filter for 2 years, put the month column on the x-axis, year on legend, and measure on value.
Use a relative date slicer or filter in Power BI - Power BI | Microsoft Learn
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Thank you for your responses! Unfortunately it has to be in the dax of the measure as I am trying to create a dynamic slicer that only affects the visual using the measures. So once the measure is selected to only OB YTD Ship CY & OB YTD Ship PY it can then be changed to visualize OB YTD Created CY & OB YTD Created PY. The requirements are for only one visual that can show both so if I can figure out the DAX I can get it to work. PS your YouTube tutorials are great! I will be spending some time on your channel.