• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Chart that shows a rolling 12 hour period|Dashboards & Charts|Excel Forum|My Online Training Hub

You are here: Home / Chart that shows a rolling 12 hour period|Dashboards & Charts|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumDashboards & ChartsChart that shows a rolling 12 hour …
sp_PrintTopic sp_TopicIcon
Chart that shows a rolling 12 hour period
Avatar
Craig Hamilton

New Member
Members
Level 0
Forum Posts: 2
Member Since:
July 4, 2019
sp_UserOfflineSmall Offline
1
July 4, 2019 - 4:43 am
sp_Permalink sp_Print

Hi 

Im new to excel and am trying to build a production counting system to count product on a conveyor line.  i am using a plc that data logs to cvs files which i then use power query to pickup every minute and bring into excel. I would like to build a dashboard to allow the operator to see there line performance.

I would like the charts to show the last 12 hours of production but have no idea how to achieve this, I have attached a basic copy of the spreadsheet if any you guys could help me out it would be much appreciatedSmile

Thank you

Craig

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
July 8, 2019 - 6:48 pm
sp_Permalink sp_Print

Hi Craig,

you should apply a filter to your query, to load only the last 12 hours data.

First, add a parameter to detect the highest date in your data, then filter data.

MaxDateTime= DateTime.From( List.Max( #"Previous Step name"[DateTimeColumn] ) ),

Use the power query editor interface and just filter the date column, uncheck one of the dates in the list just to make power query create the step for you, then edit the step to use the following criteria:

each [DateTimeField] >= MaxDateTime-#duration(0,12,0,0)

Avatar
Craig Hamilton

New Member
Members
Level 0
Forum Posts: 2
Member Since:
July 4, 2019
sp_UserOfflineSmall Offline
3
July 11, 2019 - 5:43 am
sp_Permalink sp_Print

Hi Catalin

Thank you for your reply but im not good enough with excel to understand what to do could you possible add it to the file i have attached in my first post please

 

Thank you

Craig

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
July 11, 2019 - 1:01 pm
sp_Permalink sp_Print sp_EditHistory

Try this :

let
Source = Folder.Files("C:\Users\c3ham\Documents\Count data"),
#"Filtered Rows" = Table.SelectRows(Source, each Text.EndsWith([Extension], "csv")),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Date accessed", "Date modified", "Date created", "Attributes", "Extension", "Name"}),
#"Filtered Hidden Files1" = Table.SelectRows(#"Removed Columns", each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File from Count data", each #"Transform File from Count data"([Content])),
#"Removed Other Columns1" = Table.SelectColumns(#"Invoke Custom Function1", {"Transform File from Count data"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File from Count data", Table.ColumnNames(#"Transform File from Count data"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Time", type datetime}, {"VD0", Int64.Type}, {"VD4", Int64.Type}, {"VD8", Int64.Type}, {"VD12", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"VD0", "LD IN"}, {"VD4", "LD OUT/VIS IN"}, {"VD8", "VIS OUT"}, {"VD12", "VMS OUT"}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Renamed Columns", "Time", "Time - Copy"),
#"Reordered Columns" = Table.ReorderColumns(#"Duplicated Column",{"Time", "Time - Copy", "LD IN", "LD OUT/VIS IN", "VIS OUT", "VMS OUT"}),
#"Renamed Columns1" = Table.RenameColumns(#"Reordered Columns",{{"Time", "DATE"}, {"Time - Copy", "TIME"}}),
MaxDateTime= DateTime.From( List.Max( #"Changed Type"[Time] ) ),
#"Filtered Rows1" = Table.SelectRows(#"Renamed Columns1", each ([LD IN] <> null and [Time] >= MaxDateTime-#duration(0,12,0,0) ) ),
#"Changed Type1" = Table.TransformColumnTypes(#"Filtered Rows1",{{"TIME", type time}}),
#"Extracted First Characters" = Table.TransformColumns(#"Changed Type1", {{"TIME", each Text.Start(Text.From(_, "en-GB"), 5), type text}}),
#"Filtered Rows2" = Table.SelectRows(#"Extracted First Characters", each Text.EndsWith([TIME], "00") or Text.EndsWith([TIME], "15") or Text.EndsWith([TIME], "30") or Text.EndsWith([TIME], "45")),
#"Changed Type2" = Table.TransformColumnTypes(#"Filtered Rows2",{{"TIME", type time}, {"DATE", type date}})
in
#"Changed Type2"

 

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Velouria
Guest(s) 11
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 204
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Jefferson Granemann
Glen Coulthard
Nikki Fox
Rachele Dickie
Forum Stats:
Groups: 3
Forums: 24
Topics: 6222
Posts: 27291

 

Member Stats:
Guest Posters: 49
Members: 31913
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.