Forum Discussion
Fda
7 years agoFrequent Visitor
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...
- 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() )
Fda
7 years agoFrequent Visitor
Thank you for taking your time, and it looks like its working!
Is it a heavy calculation for it to make? It's running pretty slow for me, and I've got a lot of rows left?
BekahLoSurdo
7 years agoResolver IV
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() )
- Fda7 years agoFrequent Visitor
You are a legend, that is exactly what I was looking for!
Thank you very much!
- BekahLoSurdo7 years agoResolver IV
Glad to help!