Forum Discussion

vf88's avatar
vf88
Regular Visitor
1 year ago
Solved

Quarter over Quarter Line graph

I have this visual (bar and line graph). I want to have the line graph  as the QoQ change in % of the value. The quarter end for my companies are Q1: january, Q2: April. Q3: July and Q4: October. Eve...
  • vf88's avatar
    vf88
    1 year ago

    So I was doing some testing and this seems to work as I want. I created three measures:

    1. 

    Past_Month_Value =
    VAR LastDateWithData =
        LASTDATE('Data'[Date])
    VAR PastDateWithData =
        EDATE(LastDateWithData, -3)
    RETURN
        CALCULATE(
            SUM('Data'[Value]),
            FILTER(
                'FiscalDateTable',
                'FiscalDateTable'[Date] >= EOMONTH(PastDateWithData, -1) + 1 &&
                'FiscalDateTable'[Date] <= EOMONTH(PastDateWithData, 0)
            )
        )
     
    2. 
    Recent_Month_Value =
    VAR
    LastDateWithData =
        LASTDATE('Data'[Date])
    RETURN
        CALCULATE(
            SUM('Data'[Value]),
            FILTER(
                'FiscalDateTable',
                YEAR('FiscalDateTable'[Date]) = YEAR(LastDateWithData) &&
               MONTH('FiscalDateTable'[Date]) = MONTH(LastDateWithData)
            )
        )
     
    3. 
    QoQ change test =
    DIVIDE(
        [Recent_Month_Value] - [Past_Month_Value],
        [Past_Month_Value]
    )
     
    When i add this QoQ change as my line and select 2 any two consecutive quarters it appears to be giving me my expected result