Forum Discussion

Fda's avatar
Fda
Frequent Visitor
7 years ago
Solved

Sorting rows based on two columns

Hi!   I am struggling with a data exercise and could use some help.   I would like to return the value of column A, based on a grouped value of column B, where the value of column C is the highes...
  • BekahLoSurdo's avatar
    7 years ago

    Hi Fda,

     

    Without seeing your dataset, I'm not sure about the exact performance. If you want to try another way (and compare the two for your particular dataset), this can also be done outside of Power Query by creating a new column with DAX:

     

    ColumnA_IfMax = IF ( CALCULATE ( MAX ( 'Table'[ColumnC] ), ALLEXCEPT ( 'Table', 'Table'[ColumnB] ) ) = 'Table'[ColumnC], 'Table'[ColumnA], BLANK() )