Forum Discussion
amvans_90
1 year agoRegular Visitor
Get MAX value for multiple categories
Trying to get the most recent phone number created for each office. I know it needs to be a MAX Phone # Generated ID" for each office, but I can't figure out the DAX to do it. This is a sample:
And this is what I'm trying to get to:
3 Replies
- ThxAlotSuper User
- Ashish_MathurSuper User
Hi,
This M code works
let Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Office", type text}, {"Phone #", type text}, {"Phone # Generated ID", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Office"}, {{"Count", each Table.Max(_,"Phone # Generated ID")}}), #"Expanded Count" = Table.ExpandRecordColumn(#"Grouped Rows", "Count", {"Phone #", "Phone # Generated ID"}, {"Phone #", "Phone # Generated ID"}) in #"Expanded Count"hope this helps.