Forum Discussion
Data segmentation
- 4 years ago
Thank you for your help
I ended up solving it with the formula:
FILTER ( ALL ( Sales[Year] ), Year_1 = Sales[Year] )in the end it looked like:
VAR MonthYear =
Sales[YearselectedMonth2]
VAR Year_1 =
Sales[Selected Year 2-1]
RETURN
CALCULATE (
Sum(Sales[Margin]) ,
FILTER ( ALL ( Sales[Year] ), Year_1 = Sales[Year] )
)
Hi, ngomes
If I understand correctly, you can try to add a seperated calendar table, then try formula as below:
MarginMonth =
VAR _today =
SELECTEDVALUE ( 'calendar1'[Date] )
RETURN
IF ( MONTH ( _today ) = Sales[Month], Sales[Margin], 0 )
MarginMonth =
VAR _today =
SELECTEDVALUE ( 'calendar1'[Date] )
RETURN
IF ( MONTH ( _today )-1 = Sales[Month], Sales[Margin], 0 )
Best Regards,
Community Support Team _ Eason
Thank you for your help
I ended up solving it with the formula:
FILTER ( ALL ( Sales[Year] ), Year_1 = Sales[Year] )
in the end it looked like:
VAR MonthYear =
Sales[YearselectedMonth2]
VAR Year_1 =
Sales[Selected Year 2-1]
RETURN
CALCULATE (
Sum(Sales[Margin]) ,
FILTER ( ALL ( Sales[Year] ), Year_1 = Sales[Year] )
)