Forum Discussion

walnei's avatar
walnei
Icon for Helper III rankHelper III
8 years ago
Solved

MIN/MAX EDITOR QUERY

I need to create two columns in the query editor, one that brings the minimum time and one that brings the maximum time of each category. According to print. I need to do this in the query editor. M....
  • Anonymous's avatar
    Anonymous
    8 years ago

    Ok, you can do this in DAX also, which is dynamic and faster.Select New Table under Modelling tab and use this formula :

     

    Newtable = GROUPBY('Table_1','Table_1'[Category],"Max_Time_NewColumn",MAXX(CURRENTGROUP(),'Table_1'[Time] ), "Min_Time_New_Column", MINX(CURRENTGROUP(),'Table_1[Time]))

     

    This will gie you the max and min values for each category and most importantly without duplicating your data.

     

    Thanks
    Raj