cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pamboys09 Frequent Visitor
Frequent Visitor

Need help on table or formula

Hello,

 

I'm having issue regarding formula, I'm new to this languange and currently studying it.

here's what I got stucked.

 

So I have this Table

Item#Time StampHourQuantity
A1:43:01 PM131
B1:48:01 PM131
C1:47:01 PM131
A2:39:03 PM141
B2:43:12 PM141
C3:59:13 PM151
C4:03:53 PM161
C4:12:29 PM161
C4:12:29 PM161

 

But I need to summarize the report by hourly to show on the graph.

The challenging part for me is I need to rank by hour the item # thats the earliest (or lowest timestamp), and sum the total results under all hours. If it doesnt make sense. basically these is what im looking for.

 

Rank lowest time stamp - shows the item# with the lowest time stamp for that hour.

 

HourRank Lowest Time StampResults
13A3
14A2
15C1
16C3

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Need help on table or formula

@pamboys09  Please try this as a "New Table"

 

Test11Out = 
VAR _Time = ADDCOLUMNS(SUMMARIZE(Test11,Test11[Hour],"MinTime",MIN(Test11[Time Stamp])),"Item",LOOKUPVALUE(Test11[Item#],Test11[Hour],[Hour],Test11[Time Stamp],[MinTime]))
VAR _Totals = SUMMARIZE(Test11,Test11[Hour],"Results",SUM(Test11[Quantity]))
RETURN NATURALINNERJOIN(_Time,_Totals)

image.png

 

Added the time as well, just for reference. 



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

Proud to be a Datanaut !





View solution in original post

2 REPLIES 2
jthomson New Contributor
New Contributor

Re: Need help on table or formula

Maybe look to add an index/ranking column within each hour in your dataset and use the lowest value of said index as a filter? Ranking within a group's a fairly common problem so you should be able to search and find something that works within your setup?

Super User
Super User

Re: Need help on table or formula

@pamboys09  Please try this as a "New Table"

 

Test11Out = 
VAR _Time = ADDCOLUMNS(SUMMARIZE(Test11,Test11[Hour],"MinTime",MIN(Test11[Time Stamp])),"Item",LOOKUPVALUE(Test11[Item#],Test11[Hour],[Hour],Test11[Time Stamp],[MinTime]))
VAR _Totals = SUMMARIZE(Test11,Test11[Hour],"Results",SUM(Test11[Quantity]))
RETURN NATURALINNERJOIN(_Time,_Totals)

image.png

 

Added the time as well, just for reference. 



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

Proud to be a Datanaut !





View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)