Forum Discussion
Trying2Excel
Helper I
1 year agoYoY Growth Measure
I need help with creating a DAX formula for YoY Growth in the table below. Below I will also post the code used calculate YTD reductions:
YTD Total Complete Reductions =
VAR _currentYear =
YEAR ( MAX ( 'Historical Reductions Table'[End of Month] ) )
VAR _currentMonth =
MONTH ( MAX ( 'Historical Reductions Table'[End of Month] ) )
RETURN
IF (
ISINSCOPE ( 'Historical Reductions Table'[End of Month].[Year]),
CALCULATE (
SUM ( 'Historical Reductions Table'[Reduction2] ),
FILTER (
ALLSELECTED ('Historical Reductions Table'),
YEAR ( 'Historical Reductions Table'[End of Month]) = _currentYear
&& MONTH ( 'Historical Reductions Table'[End of Month] ) <= _currentMonth
)
),
CALCULATE (
SUM ( 'Historical Reductions Table'[Reduction2] ),
FILTER (
ALLSELECTED ('Historical Reductions Table' ),
MONTH ( 'Historical Reductions Table'[Date] ) <= _currentMonth
)
)
)
1 Reply
- AnonymousNot applicable
Hello Trying2Excel
Please post you question to the Power BI forums: https://community.fabric.microsoft.com/t5/Power-BI-forums/ct-p/powerbi
Specifically for DAX: https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/bd-p/DAXCommands
Thank you,
Eileen
Fabric Community Manager