Forum Discussion
salmanalisalman
2 years agoNew Member
creating a sales difference
Dear I really need your intelegence! I need your help! I will tell you what i want at the end, plz bear with me, brothers and sisters. I have a table called " source" colmun A is "Date" containin...
bhanu_gautam
2 years agoSuper User
salmanalisalman , You can create a dax measure for this
Sales Difference =
VAR CurrentDate = 'source'[Date]
VAR CurrentBranch = 'source'[Branches]
VAR PreviousSales =
CALCULATE(
SUM('source'[Sales]),
FILTER(
'source',
'source'[Branches] = CurrentBranch &&
'source'[Date] = DATEADD(CurrentDate, -1, MONTH)
)
)
RETURN
IF(
ISBLANK(PreviousSales),
BLANK(),
'source'[Sales] - PreviousSales
)
salmanalisalman
2 years agoNew Member