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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Sum of Minimum for value of a grouped column

I'm trying to sum only one (or I guess the minimum would work) value for each repeating value in another column.

 

I have a column that duplicates the minimum hours required and then repeats in the table with a different attribute for savings % and the amount of savings across several rows.  I'm trying to calculate the initial minimum hours to see the sum of minimum hours just once for each process step ID, since it's the same value but repeated over multiple rows.

 

so group process step ID, identify the min value (which in this case is all the same), and then do a sum of all the one Min Process Tiime Hours column.

 

i.e. 

 

group 198 and only show the .25 Min Process Time Hours once, group 199 and only show the .25 min process time hours once, and do a sum of all those minimums.

 

How would I do this?? 

 

process step ID.JPGsavings cal.JPG

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous - Are all of those columns in the same table? Sorry, it's odd how it is posted so wasn't quite sure. If so, the technique should be:

 

Column =
  MINX(
    FILTER('Table',[Process Step ID] = EARLIER([Process Step ID])),
    [Min Process Time Hours]
  )

Measure =
  VAR __ProcessStepID = MAX([Process Step ID])
  MINX(
    FILTER(ALL('Table'),[Process Step ID] = __ProcessStepID),
    [Min Process Time Hours]
  )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous - Are all of those columns in the same table? Sorry, it's odd how it is posted so wasn't quite sure. If so, the technique should be:

 

Column =
  MINX(
    FILTER('Table',[Process Step ID] = EARLIER([Process Step ID])),
    [Min Process Time Hours]
  )

Measure =
  VAR __ProcessStepID = MAX([Process Step ID])
  MINX(
    FILTER(ALL('Table'),[Process Step ID] = __ProcessStepID),
    [Min Process Time Hours]
  )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for the formula! I ended up with a different work around but I do appreciate the help 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors