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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
newkingdom
Frequent Visitor

Find the max minutes based on the date, type and doctor

Hi, I have 4 columns that I will be working with: Type, Mintues, Date and doctor. So we can have an appointment type for many clients and each of them will be in the appointment for different amounts of time. Ex a back appointment for 10 patients and the the minutes they spend there ranges from 20-50. I want to account for each appointment only once for that type, date , and provider. So this appointment will not be counted as the sum of all these 10 patient times but rather just once for 50 minutes. 

 

example of data set 

 type minutesdatedoctor
Back151/1/2020Jim
Back201/1/2020Jim
Back251/1/2020Pam
Back301/1/2020Pam
Neck201/2/2020Pam
Neck221/2/2020Michael
Neck351/2/2020Michael
Neck201/2/2020Dwight
Back401/2/2020Dwight
Head201/3/2020Dwight
Head251/3/2020Dwight
Head201/3/2020Dwight
Back261/4/2020Michael
Back201/4/2020Michael
Back301/4/2020Michael
Back201/4/2020Michael
Head201/5/2020Michael
Back301/5/2020Dwight
Neck401/5/2020Pam
Shoulder501/5/2020Sam

 

And I want this data set to become essentially this

 type minutesdatedoctor
Back201/1/2020Jim
Back301/1/2020Pam
Neck351/2/2020Michael
Back401/2/2020Dwight
Head251/3/2020Dwight
Back301/4/2020Michael
Head201/5/2020Michael
Back301/5/2020Dwight
Neck401/5/2020Pam
Shoulder501/5/2020Sam

 

So basically look at the type, the date and doctor and then grab the maximum minutes. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

@newkingdom 

 

Drag the columns in a table select maximum for minute will do. 

max minute.JPG

If you want to create a column that appears in the data view: 

 

MaxMin/Doc/Type/Date = CALCULATE(MAX([ minutes]),ALLEXCEPT('Table','Table'[date],'Table'[type],'Table'[doctor]))

 

 

Community Support Team _ Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

To me, it seems like you are taking the max of the day

Look at this, if you take max(minutes) and drag rest of the stuff on table or matrix it should work.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, thanks for the reply. No I am not just taking the max of the day, but rather the max of the day for each type and doctor. 

Anonymous
Not applicable

 

@newkingdom 

 

Drag the columns in a table select maximum for minute will do. 

max minute.JPG

If you want to create a column that appears in the data view: 

 

MaxMin/Doc/Type/Date = CALCULATE(MAX([ minutes]),ALLEXCEPT('Table','Table'[date],'Table'[type],'Table'[doctor]))

 

 

Community Support Team _ Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.