Forum Discussion

Greg25's avatar
Greg25
New Member
4 years ago
Solved

Normalize time series data for display in Line Chart

Hi all,   I would like to display two time series in a normalized way to see their performance relative to each other. Think about two stocks (e.g. Apple vs. Microsoft) and I would like to visualiz...
  • mahoneypat's avatar
    4 years ago

    I looked at your file.  A few comments

    • You should use measures where possible instead of calculated columns
    • You should change the relationship to be a single-direction and 1:M
    • You should unpivot your data to make your analysis easier (i.e., your index1 and index2 values should be in the same column with a second column with the values of index1 and index2). That way you can use that second column as the legend in your visuals.
    • Below is an example measure for Index1 (I couldn't change your query to unpivot your data, so two measures still needed)
    • Attached is the modified pbix file, if useful

     

    Rel Change 1 =
    VAR vThisValue =
        MAX ( IndexData[index1_close] )
    VAR vFirstDate =
        CALCULATE ( MIN ( IndexData[DateIndex] )ALLSELECTED ( IndexData[DateIndex] ) )
    VAR vFirstClose =
        CALCULATE (
            MAX ( IndexData[index1_close] ),
            ALL ( 'Date' ),
            IndexData[DateIndex] = vFirstDate
        )
    RETURN
        DIVIDE ( vThisValue - vFirstClosevFirstClose )

     

    Pat