Forum Discussion

RavM_17's avatar
RavM_17
New Member
3 years ago
Solved

Year on year variance without dates

Hi,   I need to do a YoY variance based on a period number rather than date. I have a dates query however we report on periods and they move yearly so it's difficult to achieve by using the date fu...
  • Greg_Deckler's avatar
    3 years ago

    RavM_17 You could create a DAX Index column for your table like this and then it should be easy. PBIX is attached below signature.

     

    DAX Index = 
        VAR __TableText = CONCATENATEX(ALL('Table'),[Year] & ":" & [Period],"|",[Year]&[Period],ASC)
        VAR __Count = COUNTROWS(ALL('Table'))
        VAR __Table = 
            ADDCOLUMNS(
                GENERATESERIES(1, __Count,1),
                "__Year",LEFT(PATHITEM(__TableText,[Value]),5),
                "__Period",RIGHT(PATHITEM(__TableText,[Value]),1) + 0
            )
        VAR __Result = MAXX(FILTER(__Table,[__Year] = [Year] && [__Period] = [Period]),[Value])
    RETURN
        __Result

     

  • mangaus1111's avatar
    3 years ago

    Hi RavM_17 ,

    sorry I don´t understand how you have calculated the variance of 150%  in your example