Forum Discussion
Add column showing max value from another column
- 3 years ago
A quick work around was to create a separate SQL query and group by Opportunity and MAX index then merged the queries. Not sure if it's the most efficient but I am now getting the data I need. Thank you for taking the time.
Thank you for taking the time to help me. For the example you provided, I need the MAX index within the grouped by row so I can find the MAX index for each Opportunity. Please see screenshot. I tried using Table.Max and was able to get a little further but still receiving an error.
Here is a screenshot of attempting Table.Max
= Table.AddColumn(#"Added PrevDateTable", "MaxIndex", each let
AllDataTable = [PrevDateTable],
MaxIndex =
Table.AddColumn(
AllDataTable, "Index Max",
each Table.Max(AllDataTable, "Index MAX")[Index]
)
in
MaxIndex)
After that step, I combine all the tables. Im sure there is an easier way to go about this. I am still learning
You are going to need to provide some code samples or what the errors are. You just show the word "error" which may be a problem with how you are using it, or you may be missing a comma. No idea.
Paste your data into the ENTER DATA feature of Excel or Power BI, do your code through the error place, and paste that code.
I cannot use your code sample above because I have no clue what the code through PrevDateTable did.
- rachaelwalker3 years agoResolver III
A quick work around was to create a separate SQL query and group by Opportunity and MAX index then merged the queries. Not sure if it's the most efficient but I am now getting the data I need. Thank you for taking the time.