Forum Discussion

slhyrkl's avatar
slhyrkl
Frequent Visitor
2 years ago
Solved

How to show variation for multiple data points?

I have a dataset which has multiple values for different dates for specific part numbers. These values are getting calculated monthly but that's a new process so most of the part numbers don't have a...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi slhyrkl ,

    First of all, many thanks to ryan_mayu  for your very quick and effective replies.

    Based on my testing, please try the following methods:

    1.Create the simple table.

    2.Create the new measure to calculate the monthly values.

    Monthly values = CALCULATE(SUM('Table'[Values]), FILTER('Table', 'Table'[Month]))

    3.Create the new measure to calculate the monthly variation.

    Month Variation = 
    var numb = SELECTEDVALUE('Table'[Part number])
    VAR pre = SUMX(FILTER(ALLSELECTED('Table'),[Month] = MAX('Table'[Month]) - 1 && [Part number] = numb),[Monthly values])
    VAR SELE = MAX('Table'[Month])
    var result = [Monthly values] - pre
    RETURN
    result

    4.Drag the measure into the matrix visual.

    5.The result is shown below.

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.