Forum Discussion
PowerBIBeginer
2 years agoHelper V
help on sameperiodelast year
Hi All, I've one Dax which gives me no of volume and have derived with help of Dax. Now problem is, I've 2024 year-month column, i also derived last year 2023 year-month column. infact I've volum...
Jihwan_Kim
2 years agoSuper User
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Volume measure: =
SUM( volume_fact[volume] )
Previous year volume measure: =
CALCULATE (
SUM ( volume_fact[volume] ),
SAMEPERIODLASTYEAR ( calendar_dimension[Date] )
)
Difference measure: =
VAR _current = [Volume measure:]
VAR _previous = [Previous year volume measure:]
VAR _condition =
_current <> BLANK ()
&& _previous <> BLANK ()
&& HASONEVALUE ( calendar_dimension[Month-Year] )
RETURN
IF ( _condition, _current - _previous )
PowerBIBeginer
2 years agoHelper V
Thank you so much for your reply and valuable time share for me. Let me try this and will update you on the same..