Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
amvans_90
Regular 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:

amvans_90_0-1729800888330.png

And this is what I'm trying to get to:

amvans_90_1-1729800972312.png

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1729802981531.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super 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.

Ashish_Mathur_0-1729813185214.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ThxAlot
Super User
Super User

ThxAlot_0-1729802981531.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



FreemanZ
Super User
Super User

hi @amvans_90 ,

 

try to plot the table visual with office column and two measures like:

Max Phone# =MAX(tablename[Phone #]

MAX ID =MAX(tablename[Phone # Generated ID]

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors