Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX Help

Hi,

I'm new to DAX and would like some suggestions on how to complete the following;

Table 1 represents the data as we recieve it from the source.

In our efforts to study the data we need to review the information by comparing Run to Run

Table 2 represents the Table 1 duplicated and filtered to only include Run 1

Table 3 represents the Table 1 duplicated and filtered to only include Run 2

We would like to return Table 4, this table would represent the Run 2 - Run 1 and deliver the data row by row as it relates to the attitude column (as shown above).

 

All help appreciated!!

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Thanks for the help, this is exactly what we were looking for!!

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous  - 

    You can create a new Measure: 

    Change In Attitude = 
    var run1 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = 1)
    var run2 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = 2)
    return run2 - run1

    Hope this helps,

    Nathan

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the help!!

       

      Is there a way to make the Run selection a slicer?

      We some time have several hundred Runs to compare and creating a Measure for each senario will be quite a challange.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Yes, if you select 2 runs, you could do it like the following:

        Change In Attitude = 
        var firstrun = min('Table 1'[Run])
        var secondrun = max('Table 1'[Run]) var run1 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = firstrun) var run2 = calculate(max('Table 1'[Data]), 'Table 1'[Run] = secondrun) return run2 - run1