Forum Discussion
Year over year % change without date column
- Anonymous1 year ago
Hi Anonymous ,
Please modify the measure syntax as shown below:
event_distinctcount_PY = VAR _currentYear = VALUE ( MID ( SELECTEDVALUE ( 'Table'[year_month] ), 2, 2 ) ) VAR _currentMonth = VALUE ( MID ( SELECTEDVALUE ( 'Table'[year_month] ), 5, 2 ) ) var _Slicer_Country = VALUES('Table'[country]) RETURN CALCULATE ( DISTINCTCOUNT ( 'Table'[event] ), FILTER ( ALL ( 'Table' ), VALUE ( MID ( 'Table'[year_month], 2, 2 ) ) = _currentYear - 1 && VALUE ( MID ( 'Table'[year_month], 5, 2 ) ) = _currentMonth &&'Table'[country] IN _Slicer_Country ) )If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi Anonymous ,
When I modified from ALLSELECTED to ALL then the Country slicer stops applying to the PY measure. Is there a way we can modify it so that this measure will be filtered by all other slicers but not the year_month slicer?
Thank you!
Hi Anonymous ,
Please modify the measure syntax as shown below:
event_distinctcount_PY =
VAR _currentYear =
VALUE ( MID ( SELECTEDVALUE ( 'Table'[year_month] ), 2, 2 ) )
VAR _currentMonth =
VALUE ( MID ( SELECTEDVALUE ( 'Table'[year_month] ), 5, 2 ) )
var _Slicer_Country = VALUES('Table'[country])
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[event] ),
FILTER (
ALL ( 'Table' ),
VALUE ( MID ( 'Table'[year_month], 2, 2 ) ) = _currentYear - 1
&& VALUE ( MID ( 'Table'[year_month], 5, 2 ) ) = _currentMonth
&&'Table'[country] IN _Slicer_Country
)
)
If you have any other questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!