• 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

Power Query M for Horizontal List|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Power Query M for Horizontal List|Power Query|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 ForumPower QueryPower Query M for Horizontal List
sp_PrintTopic sp_TopicIcon
Power Query M for Horizontal List
Avatar
Robert Rafferty
Member
Members
Level 0
Forum Posts: 32
Member Since:
September 15, 2020
sp_UserOfflineSmall Offline
1
September 15, 2020 - 4:13 am
sp_Permalink sp_Print

How do I create a list of  September dates that goes across.

For example:

100          9/1/20    9/2/20   9/3/20

101

102

103

 

Thanks

sp_AnswersTopicSeeAnswer See Answer
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
September 15, 2020 - 7:57 am
sp_Permalink sp_Print

Hi Robert,

This might sound odd, but why would you want to do that?  It breaks the ideal tabular data format.  You should have dates in a single column.

Maybe if you can explain in more detail what you are doing, and supply a workbook example with source data, I can give you an answer to the problem.

Regards

Phil

Avatar
Robert Rafferty
Member
Members
Level 0
Forum Posts: 32
Member Since:
September 15, 2020
sp_UserOfflineSmall Offline
3
September 16, 2020 - 6:28 am
sp_Permalink sp_Print

Hi Phil:

Thanks for your response! See attached.

Makes sense now that I think about it as you point out. 

However, when loading to a pivot table I am unable to have full month go across, only dates within data.

Is this best way to provide attachments?

 

Regards

Robb

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
September 16, 2020 - 9:54 am
sp_Permalink sp_Print sp_EditHistory

Hi Robb,

Your PT will only display the data you feed into it.  So if you want to show all dates in a month, you need to have all those dates in the source table.

Of course if you have to add dates where there were no check-ins, the PT will display a blank for that date.

Please see attached.  I've created a new query to process the data on 'HD Export_June 2020' into a table on the sheet 'MOTH Table' without any errors.

I've created a PT from this table on sheet 'MOTH PT'.  This is displaying the total duration of stays on a given date at a given location.  Hope this points you in the right direction but happy to help more if needed.

Cheers

Phil

P.S. Yes, attaching files to the post is the correct way to provide them to us.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4449
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
5
September 16, 2020 - 9:36 pm
sp_Permalink sp_Print

Hi Robb,

In PivotTables that contain date fields you can right-click the date field > Field Settings > Layout & Print tab > Show items with no data. This will display the dates for the entire year, or years if your data spans multiple years. You'd then need to apply a filter to exclude the dates you don't want, but that's easy enough.

Hope that's of use, otherwise use Phil's solution.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
Robert Rafferty
Member
Members
Level 0
Forum Posts: 32
Member Since:
September 15, 2020
sp_UserOfflineSmall Offline
6
September 18, 2020 - 7:55 am
sp_Permalink sp_Print

Hi Phil:

What did you do to remove the errors?

It was driving me crazy trying to figure out cause and fix.

And Thank You Mynda for SHOW ITEMS WITH NO DATA technique. perfect.

 

Regards

Robb

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
7
September 18, 2020 - 9:28 am
sp_Permalink sp_Print sp_EditHistory

Hi Robb,

With detective work!  🙂

The first thing I did was create a table showing me the errors.  You can do this by clicking on the number of errors shown in the query after it's loaded to Excel.  See the first image below errors.png

This creates a table and opens up the PQ Editor showing the columns with errors.  You can click into an individual record to get a preview of its contents.  In the click-error.png image below you can see I've clicked into the first error 'cell' in the Check In DateTime Column.  Do not click the word 'Error' - that adds another step to the Applied Steps.  Easy enough to remove but not necessary to see the error description.

This shows you the actual error description in a pane at the bottom of the editor window - see the error-desc.png image - which tells me that this particular error is caused by parsing the input to the column Check In DateTime

Looking at the Applied Steps back in your Table1 query there is this

= Table.SplitColumn(#"Renamed Columns", "Check Ins", Splitter.SplitTextByPositions({0, 3}, true), {"Check Ins.1", "Check Ins.2"})

So the CheckIns column is being split with the intention of splitting off the last 3 characters, which is the time zone, and in the preview is shown as EDT.

But checking back with the errors query (click-error.png) you can see that some time zones use 4 characters. This is the cause of the errors.  When you split these 4 char timezones you're leaving behind 1 character in the date/time column and that messes up any subsequent attempts to treat those values as datetimes.

To fix the problem I replaced your Table.SplitColumn step with a step that split the column by delimiter, splitting the column at the right-most space character, thus removing all timezones strings regardless of how many characters they contain.

If you look at my steps, you can check steps 2 and 4 to see what I did.

These types of errors are a bit annoying because you create your query based on the preview data in front of you, and that showed timezones with 3 characters.  PQ didn't show you the timezones with 4 characters 🙁

Cheers

Phil

sp_PlupAttachments Attachments
  • sp_PlupImage click-error.png (12 KB)
  • sp_PlupImage error-desc.png (6 KB)
  • sp_PlupImage errors.png (10 KB)
Avatar
Robert Rafferty
Member
Members
Level 0
Forum Posts: 32
Member Since:
September 15, 2020
sp_UserOfflineSmall Offline
8
September 20, 2020 - 2:37 pm
sp_Permalink sp_Print

Phil:

You are life saver on this one.  I can correct my other month sort error, too.

 

Regards

Robb

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1518
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
9
September 21, 2020 - 10:07 am
sp_Permalink sp_Print

No worries 🙂

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: dan conner, Emma Klonowski, Christoffer Sandberg
Guest(s) 10
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:
Brett Dryland
Saeed Aldousari
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Jefferson Granemann
Glen Coulthard
Nikki Fox
Rachele Dickie
Raj Mattoo
Forum Stats:
Groups: 3
Forums: 24
Topics: 6222
Posts: 27291

 

Member Stats:
Guest Posters: 49
Members: 31912
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.