Forum Discussion
help on sameperiodelast year
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 )
Hi Jihwan_Kim.. Appriciate your effort for understanding mu issue exactly well and try to plot across very nicely. I would like to hightlight here something that, Volume Measure you've taken simply sum of one column, even I do that but using one filter condition in that.
for e.g.
volume = calculate(sum(tblname[volume]), tblname[onecolumn]="VC")
and hence I designed Previous year Volume like below but I got blanks..
Previuos year volume = CALCULATE(
SUM(tblname[Volume]),
tblname[onecolumn]="VC",
SAMEPERIODLASTYEAR(tblname[date]))
- Ashish_Mathur2 years agoSuper User
Hi,
You have not created a calendar Table, as suggested by Jihwan. Study his solution carefully.
- PowerBIBeginer2 years agoHelper V
Hello Ashish Sir, please refer post no 6 in which I post that I've now used date table and date field even and I got the values but against 2024 2023 value is not appearing