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
mmunozjr5
Frequent Visitor

Show Highest Value Per Two Variables (Category) and (Hour)

Hello,

I would like to create a table or graph that would only show the Hour and Total Count for that hour but for only the highest value for each category. For example, for this scenario, it would show 4 bars or rows in a table as follows: (Dataset enclosed) Thank you!

 

 

Call    |  2:00 PM | Total = 2

Email |  1:00 PM | Total = 3

Page  | 9:00 AM | Total = 2

Text   | 8:00 AM |  Total  = 5

 

mmunozjr5_0-1715127824969.png

 

CategoryHourCount
Text1:00 PM1
Email9:00 AM1
Email10:00 AM1
Call11:00 PM1
Page9:00 AM1
Text8:00 AM1
Email10:00 PM1
Email4:00 PM1
Call2:00 PM1
Page3:00 PM1
Text8:00 AM1
Email2:00 PM1
Email1:00 PM1
Call10:00 PM1
Email8:00 AM1
Call2:00 PM1
Email1:00 PM1
Text10:00 PM1
Text8:00 AM1
Text2:00 PM1
Text1:00 PM1
Text10:00 PM1
Text8:00 AM1
Text2:00 PM1
Call1:00 PM1
Call4:00 PM1
Email2:00 PM1
Email11:00 AM1
Page8:00 AM1
Email4:00 PM1
Page9:00 PM1
Email10:00 PM1
Call9:00 AM1
Email1:00 PM1
Text10:00 AM1
Text9:00 AM1
Page10:00 AM1
Page11:00 PM1
Page9:00 AM1
Text8:00 AM1



1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

 

@mmunozjr5 

you can do this in pq

let
Source = Table,
#"Grouped Rows" = Table.Group(Source, {"Category", "Hour"}, {{"value", each List.Sum([Count]), type nullable number}}),
Custom1 = Table.AddColumn(#"Grouped Rows","Rank",each Table.RowCount(Table.SelectRows(#"Grouped Rows",(x)=>x[value]>[value] and x[Category]=[Category]))+1),
#"Filtered Rows" = Table.SelectRows(Custom1, each ([Rank] = 1)),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Rank"})
in
#"Removed Columns"

 

 

pls see the attachment below

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

 

@mmunozjr5 

you can do this in pq

let
Source = Table,
#"Grouped Rows" = Table.Group(Source, {"Category", "Hour"}, {{"value", each List.Sum([Count]), type nullable number}}),
Custom1 = Table.AddColumn(#"Grouped Rows","Rank",each Table.RowCount(Table.SelectRows(#"Grouped Rows",(x)=>x[value]>[value] and x[Category]=[Category]))+1),
#"Filtered Rows" = Table.SelectRows(Custom1, each ([Rank] = 1)),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Rank"})
in
#"Removed Columns"

 

 

pls see the attachment below

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu Thank you so much for your time and effort in providing me with this solution. Perfect! Thanks!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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
Top Kudoed Authors