Forum Discussion

cfausnaught's avatar
cfausnaught
Frequent Visitor
8 years ago
Solved

Confusion with DAX syntax, difference between rows?

Hi! I'm having some trouble understanding DAX syntax when it comes to differences between rows. I want to accomplish this in its own column for a matrix...   if ('Table'[Date].[Year] - 1 == EARLIER...
  • cfausnaught's avatar
    8 years ago

    After some headscratching I came up with a solution that seems to be working... here it is for those who have similar problems!

     

    Year Delta = IF(LOOKUPVALUE('Signings and Losses'[TypeCount],'Signings and Losses'[DateSum],[LastDateSum],'Signings and Losses'[Type],'Signings and Losses'[Type])>0,
    'Signings and Losses'[TypeCount] - LOOKUPVALUE('Signings and Losses'[TypeCount],'Signings and Losses'[DateSum],[LastDateSum],'Signings and Losses'[Type],'Signings and Losses'[Type])

    , 0)