Forum Discussion

Timahake8's avatar
Timahake8
Frequent Visitor
10 months ago
Solved

Creating a custom column

Hi, I need help to create two customs, one returning the max value of an existing row and the second custom column returning the minimum of the existing row so I can get the diff between the max and ...
  • Cookistador's avatar
    Cookistador
    10 months ago

    Hello, sorry for the missmatch

     

    The easiest way to achieve that in PQ, would be to create a summarized table and join your two tables

     

    To achieve that, make a right click on the table and select reference (it will create a shortcut of the source table)

     

    Then, in our new table, go in home and click on group by and in advanced, add a max column and a min column

     

    Now, you have the desired table, in this table, add a calculated column to make the difference between max and min

     

    Then go back in your main table, and click on merge queries (create a new query) and select dpt for both table

     

     

    Now, extend the desired column and you have your desired table

    Just for the two tables you use at the begining,  make a right click on it and untick enable load (just to avoid too see these tables in your semantic model)

  • Timahake8's avatar
    Timahake8
    10 months ago

    Thank you!😊 This worked