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.
I am receiving values for all dates. My calendar has dates up to 2 years in the future. I would like to return only ORDER_QTY for current year in this measure, then an additional measure to return only previous year. End result should be two lines, one for current year another for previous year.
Current results:
Desired results would look similar to this:
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.