The Ultimate Guide to Functions in Power Query: Turn Raw Data into Actionable Insights 1st Edition Omid Motamedisedeh instant download
The Ultimate Guide to Functions in Power Query: Turn Raw Data into Actionable Insights 1st Edition Omid Motamedisedeh instant download
https://ebookmass.com/product/the-ultimate-guide-to-functions-in-power-
query-turn-raw-data-into-actionable-insights-1st-edition-omid-
motamedisedeh/
https://ebookmass.com/product/the-ultimate-guide-to-functions-in-
power-query-omid-motamedisedeh/
https://ebookmass.com/product/postgresql-query-optimization-the-
ultimate-guide-to-building-efficient-queries-2nd-edition-dombrovskaya/
https://ebookmass.com/product/the-ultimate-kids-guide-to-the-universe-
jenny-marder/
https://ebookmass.com/product/leveling-up-with-sql-advanced-
techniques-for-transforming-data-into-insights-mark-simon/
Microsoft Excel Power Pivot & Power Query For Dummies, 2nd
Edition Michael Alexander
https://ebookmass.com/product/microsoft-excel-power-pivot-power-query-
for-dummies-2nd-edition-michael-alexander/
Omid Motamedisedeh
The Ultimate Guide to Functions in Power Query: Turn Raw Data into
Actionable Insights
Omid Motamedisedeh
Brisbane, QLD, Australia
Acknowledgments�����������������������������������������������������������������������������xxi
Introduction�������������������������������������������������������������������������������������xxiii
v
Table of Contents
Table��������������������������������������������������������������������������������������������������������������31
Function���������������������������������������������������������������������������������������������������������31
Type Conversion��������������������������������������������������������������������������������������������������32
Converting Values to the Number Format������������������������������������������������������33
Converting Values to the Text Format������������������������������������������������������������34
Converting Values to the Date and Time Format�������������������������������������������35
Converting Values to the Record Format�������������������������������������������������������35
Conclusion����������������������������������������������������������������������������������������������������������36
vi
Table of Contents
vii
Table of Contents
Date.Day��������������������������������������������������������������������������������������������������������94
Date.DayOfWeek��������������������������������������������������������������������������������������������94
Date.DayOfWeekName�����������������������������������������������������������������������������������95
Date.WeekOfMonth����������������������������������������������������������������������������������������95
Date.WeekOfYear�������������������������������������������������������������������������������������������96
Date.Month����������������������������������������������������������������������������������������������������96
Date.MonthName�������������������������������������������������������������������������������������������97
Date.DayOfYear����������������������������������������������������������������������������������������������97
Date.Year�������������������������������������������������������������������������������������������������������98
Summary������������������������������������������������������������������������������������������������������������98
viii
Table of Contents
List.Select����������������������������������������������������������������������������������������������������122
List.FindText������������������������������������������������������������������������������������������������123
Removing Values in a List���������������������������������������������������������������������������������124
List.RemoveNull�������������������������������������������������������������������������������������������124
List.Distinct��������������������������������������������������������������������������������������������������125
List.RemoveFirsN and List.RemoveLastN����������������������������������������������������126
List.RemoveRange���������������������������������������������������������������������������������������127
List.RemoveItems����������������������������������������������������������������������������������������128
List.Skip�������������������������������������������������������������������������������������������������������129
List.Alternate�����������������������������������������������������������������������������������������������129
List Merging������������������������������������������������������������������������������������������������������131
List.Combine������������������������������������������������������������������������������������������������131
List.InsertRange������������������������������������������������������������������������������������������132
List.Zip���������������������������������������������������������������������������������������������������������133
List.Union�����������������������������������������������������������������������������������������������������133
List.Intersect������������������������������������������������������������������������������������������������134
List.Difference���������������������������������������������������������������������������������������������135
Mathematical Calculations on the Data of a List����������������������������������������������136
List Information Functions��������������������������������������������������������������������������������139
List.IsEmpty�������������������������������������������������������������������������������������������������140
List.IsDistinct�����������������������������������������������������������������������������������������������140
List.Contains������������������������������������������������������������������������������������������������141
List.ContainsAll��������������������������������������������������������������������������������������������142
List.ContainsAny������������������������������������������������������������������������������������������143
List.AllTrue���������������������������������������������������������������������������������������������������144
List.AnyTrue�������������������������������������������������������������������������������������������������144
ix
Table of Contents
Positions in a List����������������������������������������������������������������������������������������������144
List.Positions�����������������������������������������������������������������������������������������������145
List.PositionOf���������������������������������������������������������������������������������������������145
List.PositionOfAny����������������������������������������������������������������������������������������147
Replacing and Transforming Values������������������������������������������������������������������148
List.ReplaceValue����������������������������������������������������������������������������������������148
List.ReplaceMatchingItems�������������������������������������������������������������������������149
List.ReplaceRange���������������������������������������������������������������������������������������151
List.Transform����������������������������������������������������������������������������������������������152
List.TransformMany�������������������������������������������������������������������������������������153
Other Functions�������������������������������������������������������������������������������������������������154
List.Single����������������������������������������������������������������������������������������������������154
List.SingleOrDefault�������������������������������������������������������������������������������������154
List.Repeat���������������������������������������������������������������������������������������������������155
List.Split�������������������������������������������������������������������������������������������������������156
Summary����������������������������������������������������������������������������������������������������������157
Chapter 7: Records���������������������������������������������������������������������������159
Defining a Record���������������������������������������������������������������������������������������������159
Record Properties���������������������������������������������������������������������������������������������162
Record.FieldCount���������������������������������������������������������������������������������������162
Record.FieldNames�������������������������������������������������������������������������������������163
Record.FieldValues��������������������������������������������������������������������������������������163
Record.ToList�����������������������������������������������������������������������������������������������164
Record.Field������������������������������������������������������������������������������������������������164
Record.FieldOrDefault���������������������������������������������������������������������������������165
Record.HasFields�����������������������������������������������������������������������������������������166
x
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Table of Contents
Record Correction���������������������������������������������������������������������������������������������167
Record.AddField������������������������������������������������������������������������������������������167
Record.Combine������������������������������������������������������������������������������������������168
Record.SelectFields�������������������������������������������������������������������������������������168
Record.RemoveFields����������������������������������������������������������������������������������170
Record.RenameFields����������������������������������������������������������������������������������172
Record.ReorderFields����������������������������������������������������������������������������������173
Record.TransformFields�������������������������������������������������������������������������������174
Record Conversion��������������������������������������������������������������������������������������������175
Record.FromList������������������������������������������������������������������������������������������175
Record.FromTable����������������������������������������������������������������������������������������176
Record.ToTable��������������������������������������������������������������������������������������������177
Summary����������������������������������������������������������������������������������������������������������177
Chapter 8: Tables������������������������������������������������������������������������������179
Creating a Table������������������������������������������������������������������������������������������������180
Table.FromColumns�������������������������������������������������������������������������������������180
Table.FromRows������������������������������������������������������������������������������������������182
Table.FromRecords��������������������������������������������������������������������������������������185
Table.FromValue������������������������������������������������������������������������������������������187
Table Conversion�����������������������������������������������������������������������������������������������189
Table.ToRecords�������������������������������������������������������������������������������������������190
Table.ToColumns������������������������������������������������������������������������������������������190
Table.ToRows�����������������������������������������������������������������������������������������������191
Table.ToList��������������������������������������������������������������������������������������������������192
Table.Column�����������������������������������������������������������������������������������������������193
Table.TransformRows����������������������������������������������������������������������������������194
Table.Split����������������������������������������������������������������������������������������������������195
Table.SplitAt�������������������������������������������������������������������������������������������������196
xi
Table of Contents
Information��������������������������������������������������������������������������������������������������������197
Selecting Table Rows����������������������������������������������������������������������������������������200
Table.FirstValue�������������������������������������������������������������������������������������������201
Table.First and Table.Last����������������������������������������������������������������������������201
Table.FirstN and Table.LastN������������������������������������������������������������������������202
Table.Max and Table.Min�����������������������������������������������������������������������������204
Table.MaxN and Table.MinN�������������������������������������������������������������������������206
Table.Range�������������������������������������������������������������������������������������������������208
Table.SelectRows����������������������������������������������������������������������������������������209
Table.SelectRowsWithErrors������������������������������������������������������������������������212
Deleting Table Rows������������������������������������������������������������������������������������������214
Table.RemoveFirstN and Table.RemoveLastN����������������������������������������������214
Table.Distinct�����������������������������������������������������������������������������������������������217
Table.Skip����������������������������������������������������������������������������������������������������219
Table.RemoveRows��������������������������������������������������������������������������������������221
Table.AlternateRows������������������������������������������������������������������������������������222
Table.RemoveRowsWithErrors���������������������������������������������������������������������224
Table.RemoveMatchingRows�����������������������������������������������������������������������225
Insert and Replace Table Rows�������������������������������������������������������������������������227
Table.InsertRows�����������������������������������������������������������������������������������������228
Table.ReplaceRows��������������������������������������������������������������������������������������229
Table.ReplaceMatchingRows�����������������������������������������������������������������������231
Table.Repeat������������������������������������������������������������������������������������������������232
Order of rows����������������������������������������������������������������������������������������������������234
Table.ReverseRows�������������������������������������������������������������������������������������234
Table.Sort�����������������������������������������������������������������������������������������������������235
Checking a Condition in All Rows����������������������������������������������������������������������238
xii
Table of Contents
Table.IsDistinct��������������������������������������������������������������������������������������������238
Table.MatchesAllRows���������������������������������������������������������������������������������239
Table.MatchesAnyRows�������������������������������������������������������������������������������241
Table.Contains���������������������������������������������������������������������������������������������242
Table.ContainsAll and Table.ContainsAny����������������������������������������������������244
Table.SingleRow������������������������������������������������������������������������������������������245
Column Names��������������������������������������������������������������������������������������������������246
Table.ColumnNames������������������������������������������������������������������������������������246
Table.DemoteHeaders����������������������������������������������������������������������������������246
Table.PromoteHeaders���������������������������������������������������������������������������������247
Table.HasColumns���������������������������������������������������������������������������������������249
Table.ColumnsOfType����������������������������������������������������������������������������������250
Table.PrefixColumns������������������������������������������������������������������������������������251
Table.RenameColumns��������������������������������������������������������������������������������252
Modifing columns���������������������������������������������������������������������������������������������255
Table.RemoveColumns��������������������������������������������������������������������������������256
Table.SelectColumns�����������������������������������������������������������������������������������259
Table.DuplicateColumn��������������������������������������������������������������������������������263
Table.TransformColumnTypes����������������������������������������������������������������������265
Table.TransformColumns�����������������������������������������������������������������������������267
Table.AddIndexColumn��������������������������������������������������������������������������������271
Table.AddColumn�����������������������������������������������������������������������������������������274
Table.AddRankColumn���������������������������������������������������������������������������������277
Table.SplitColumn����������������������������������������������������������������������������������������281
Table.CombineColumns�������������������������������������������������������������������������������285
Table.CombineColumnsToRecord����������������������������������������������������������������288
Table.ReorderColumns���������������������������������������������������������������������������������290
Table.Pivot���������������������������������������������������������������������������������������������������291
xiii
Table of Contents
Table.Unpivot�����������������������������������������������������������������������������������������������294
Table.Group��������������������������������������������������������������������������������������������������297
Table.Transpose�������������������������������������������������������������������������������������������301
Combining Tables����������������������������������������������������������������������������������������������303
Table.Combine���������������������������������������������������������������������������������������������303
Table.Join����������������������������������������������������������������������������������������������������308
Table.NestedJoin�����������������������������������������������������������������������������������������317
Expanding Columns������������������������������������������������������������������������������������������319
Table.ExpandListColumn������������������������������������������������������������������������������320
Table.ExpandRecordColumn������������������������������������������������������������������������322
Table.ExpandTableColumn���������������������������������������������������������������������������326
Table.AggregateTableColumn����������������������������������������������������������������������329
Replacing Column Values����������������������������������������������������������������������������������330
Table.FillDown and Table.FillUp�������������������������������������������������������������������331
Table.ReplaceErrorValues����������������������������������������������������������������������������334
Table.ReplaceValue��������������������������������������������������������������������������������������337
Finding a Value in a Table����������������������������������������������������������������������������������340
Table.FindText����������������������������������������������������������������������������������������������340
Table.PositionOf�������������������������������������������������������������������������������������������341
Table.PositionOfAny�������������������������������������������������������������������������������������344
Summary����������������������������������������������������������������������������������������������������������345
xiv
Table of Contents
Excel.CurrentWorkbook�������������������������������������������������������������������������������������357
Summary����������������������������������������������������������������������������������������������������������357
Index�������������������������������������������������������������������������������������������������383
xv
About the Author
Omid Motamedisedeh is a freelance data and
business intelligence analyst with a PhD in
Industrial Engineering. He’s currently working
towards his second PhD at Queensland
University of Technology. Omid is the author
of several articles in industry journals (Electric
Power Systems Research, Journal of Building
Engineering, Energy, Neural Computing and
Applications, and others), and seven books (all
in Farsi) namely Managing Data Entry in Excel by Data Validation, Data
Analysis by Excel’s Pivot Table, Power Query as The Magic of Excel, 222
Most Useful Functions in Excel 2016, Useful Excel Functions in Excel 2019,
Reference of Functions in Excel 2021, and From Drawing Charts to Creating
Dashboards in Excel 2016.
xvii
About the Technical Reviewer
Bo Rydobon (a.k.a. Excel Wizard) is a Microsoft Excel expert and YouTuber
from Thailand who is known for his speed and mastery of Excel. He is also
the creator of the Excel Wizard YouTube channel, where he shares tips and
tricks on how to use advanced dynamic arrays. He actively contributes
on Excelforum.com and became a Top 5 reputation within a few years.
His participation in the Excel BI LinkedIn Excel Challenge drew notable
attention due to his impressive response. In 2022, Bo Rydobon won the
Excel Esports Speedrun organized by the Financial Modeling World Cup.
Bo Rydobon is an inspiration to Excel users all over the world.
He shows that anyone can learn Excel and become an expert, regardless of
their background or experience.
xix
Acknowledgments
I would like to express my sincere gratitude to the individuals who have
played an indispensable role in supporting me throughout the process
of writing this book. My appreciation extends to both those within my
professional circle and those who hold a personal place in my life.
First and foremost, I extend heartfelt thanks to Faranak, whose
unwavering belief in me and encouragement provided the catalyst for
embarking on this writing journey.
I am equally grateful to Bo Rydobon, my esteemed technical reviewer,
whose invaluable insights and motivating feedback have significantly
enriched the quality of this work.
Furthermore, I wish to extend my thanks to the Apress team, including
Susan McDermott (Editorial Director), Shobana Srinivasan (Book
Coordinator), and Shaul Elson (Editorial Manager), for their commendable
professionalism and collaborative approach. Their contributions have
transformed working with Apress into a truly gratifying experience.
Lastly, my profound and enduring appreciation goes to Professor
Hamid Reza Irani, who imparted foundational knowledge of Excel during
my undergraduate years, and to Mike Girvin, a cherished Excel mentor.
Mike's prolific Excel tips shared on the ExcelIsFun YouTube channel have
been a wellspring of learning for all Excel fans like me.
xxi
Introduction
In today's data-driven landscape, the ability to seamlessly transform raw
data into meaningful insights is a skill of paramount importance. The
Ultimate Guide to Functions in Power Query stands as a beacon for Excel
and Power BI enthusiasts, equipping them with the tools to unlock the full
potential of their data manipulation endeavors.
In this comprehensive guide, you will delve into the world of Power
Query functions, the building blocks that empower users to effortlessly
manipulate, cleanse, and refine their data. Whether you're a seasoned
data professional or a novice user, this book is designed to elevate your
proficiency in harnessing the capabilities of Power Query functions,
ultimately enabling you to convert seemingly complex datasets into
actionable insights.
Join me on a journey through the intricacies of Power Query functions
as I demystify their functionalities, explore real-world use cases, and
provide step-by-step guidance on their application. With a meticulous
balance of theory and hands-on practice, The Ultimate Guide to Functions
in Power Query is not just a book; it's your indispensable companion in
mastering the art of data transformation.
Chapters include
xxiii
Introduction
xxiv
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Exploring the Variety of Random
Documents with Different Content
introduction, or intimated to them, in the remotest manner, his
disapprobation: or spoke any where against baptism as administered by
his harbinger, John the baptist, as if it were a piece of superstition—or
an empty form: but he received it himself, which is at least a
presumptive argument, that water-baptism was to be an ordinance in
his religion; for John came to prepare the way of the Lord, in all
respects, and to dispose people in their minds, to receive the Christian
System; but if there were to be no christian baptism, how could John’s
baptizing unto repentance be from heaven or a preparation for the
introduction of the Gospel-System? If Jesus Christ designed to have no
such ordinance, to be a standing ordinance, in his Church, to the end
of the world, we should have had, we rationally suppose, some direct or
implied hint at least of his dislike of baptizing with water. For when he
gave his eleven disciples, and virtually, in them, all his true Ministers,
the commission in the text, go teach all nations, baptizing them, in the
name of the Father—and of the Son, and of the holy Ghost, they could
not understand him, but as instituting and appointing the ordinance of
water-baptism. As they had been universally, during his public
Ministry, in the practice of it, if he had intended to have the practise
discontinued, he would have told them so:—he would have forbid
them to continue it, and told them it was an idle ceremony—a perfectly
useless and insignificant rite—no better than old Jewish fables—and
wholly unbecoming the nature of his own spiritual religion. But there is
not a word of this. On the other hand he, in the most solemn manner
possible, commanded them to go and baptize all that should embrace
his religion, professedly, throughout the world. And after being
endowed with power from on high, on the day of Pentecost, or baptized
with the holy Ghost, that is, invested with his miraculous gifts, they
continued to dispense the ordinance of water-baptism, as they had
done before. As they gathered and organized Churches over the world,
and preached Christ and him crucified, they dispensed water-baptism
to all their converts, not one excepted, that we hear of, or know of: and
so careful were they about this matter that they even baptized some of
John’s disciples over again. In the progress of their labours, they
gathered an immense number of churches in Asia, in Europe, in Africa,
in all parts of the then known world. And they were uniform in their
practice. All the churches were formed doubtless upon the same
model. They did not practise baptism in some instances, or omit it in
others. They administered it to all, as the standing introductory
ordinance. They did this, as long as it pleased the great head of the
church to employ them in his work. They had with them, when they
did thus practise, the promised comforter: That holy spirit who was to
assist them—to inspire them—to secure them from all error in
doctrine or discipline—to lead them into all truth: to be an infallible
guide to them. All these are facts. And all, who believe the holy
scriptures, cannot help knowing them to be facts. I appeal to them as
facts. I have proved them to be facts, in the large number of texts cited
under the last argument. With an irresistible evidence, then, doth it
appear, that water-baptism was the stated universal practice of the
Apostles. The union of the Apostles, in the practice, will be particularly
noticed and enlarged upon, under another head of proof.—Now, what
can be said against baptism by water, as an appointment of Jesus
Christ, and not a piece of superstition? Is any truth—is any duty—is
any point of christianity more substantially proved, more clearly
revealed?—So plain is this matter that it cannot, one would imagine,
be contested. However to get rid of the argument and of the ordinance,
it is said the Apostles, it is true, did practise it; but did administer it in
ignorance—as uninformed and erring men—in weakness, and
condescension to the wicked humours of their hearers:—but all along
told them it was unnecessary and unprofitable—no Gospel-ordinance
—but weak and beggarly elements—rudiments of the world—an
abrogated rite—an abolished institution—old things that must pass
away.—Strange indeed! Alas, did the Apostles practise this ordinance
in ignorance, and to gratify prejudice in their converts? They acted,
then, very wickedly. For they have herein set an example to all the
christian world, in every age, and land. For all the various communions
have followed their practice, for more than Seventeen centuries,
though differing about the modes and circumstances of it. If, then, we
be in an error, we have been led into it by Christ and his Apostles, by
following them in administering baptism as an ordinance, in his
spiritual religion. For his kingdom is not of this world, it is a spiritual
and heavenly kingdom. Are we not safer in following the Apostles, as
inspired guides, in doctrine, and worship, and ordinances, than in
listening to such as tell us they were weak and ignorant men?—But be
pleased, to consider a moment, my hearers,——Who can believe that,
under the baptism of the holy Ghost, his miraculous inspiring
influence, the Apostles would have practised water-baptism
universally, if it had not been the mind and will of Jesus Christ, that
there should be such an ordinance, in his religion?
7thly. It may tend to corroborate the proof that there is such an
ordinance to be observed in the church of God, that it was the common
received opinion, in the times of John the baptist, that the promised
Messiah, the great Saviour of Man, would practise baptism by water in
his ministry and kingdom. The people objected against John’s baptism,
because he declared that he was not the Christ, John i. 25. Why
baptizest thou, if thou be not the Christ? This question most obviously
and clearly implies that it was expected that Christ, the promised
Messiah, would have baptism by water, statedly practised, in his
kingdom or dispensation. Why baptizeth thou, if thou be not the
Christ? As many as if they had said, you take too much upon you, in
your baptizing: you assume one of the offices of the Messiah. We
expect he will have baptism, in his kingdom, as an initiation, or
introductory ordinance, representing our need of renovation.—The
Jews might be mistaken in their ideas of the expected Messiah, in this,
as in other respects.—What is now mentioned is only to show what the
common expectation was. And that common belief must have had
something to be grounded upon.—
8thly. Another consideration of no inconsiderable importance to prove,
that baptism by water, was to be a stated ordinance, in the New-
Testament-dispensation, is taken from those passages of scripture,
which do not directly, but impliedly assert, or allude to water-baptism,
as a stated ordinance or practice, in the Apostolic and primitive
Church. Titus iii. 15. Not by works of righteousness, which we have
done, but according to his mercy, he saved us by the washing of
regeneration and renewing of the holy Ghost. Paul is here guilty of a
needless repetition, or else he intends two different things, by the
washing of regeneration and renewing of the holy Ghost. By the first,
most Commentators and learned men, suppose he must intend
baptism by water as a sign of the renewing of the holy Ghost. The
original word translated washing of regeneration is the laver of
regeneration—alluding to the laver or vessel to wash in, in the Jewish
tabernacle and temple. We must be baptized, then, as well as renewed.
The Apostle here speaks, indeed, most honourably of baptism, if he
intend it, at all, as doubtless he doth.—Ephe. v. 26. That he might
sanctify it, that is, the Church, having cleansed it by the washing of
water, by the word. Christian baptism is generally supposed to be
alluded to, in this passage, as one thing implied in being cleansed, in
being regular and proper members of Christ’s Church. Romans, vi. 4.
We are buried with him by baptism. How absurd would such an
expression be, if there were no ordinance of baptism statedly
administered!—It would be unintelligible to the Christians at Rome.
What does the beloved Apostle mean? they would naturally say: We
know of no such ordinance as baptism. He must have forgotten
himself, or he would not speak of our being buried with Christ in
baptism.—We have a similar allusion to the ordinance of baptism in
Col. ii. 12. Buried with him, that is Christ, in baptism. If Christ would
have no baptism, as a stated ordinance, how improper all such
allusions to it. This scripture applies to all Christians, in all ages and
parts of the world, who have the Gospel. But what instruction doth it
contain in such allusions, if there be no ordinance of baptism?—More
texts of this kind might be easily added, but these are enough as a
specimen. If not of themselves a sufficient proof of the point before us,
still they confirm the other arguments already adduced.—
9thly. It may, with much force be added here, as a convincing and
satisfactory proof of the Institution of baptism by water, as a standing
ordinance, in the Gospel dispensation, that the Apostles were
unanimous in the administration of it, as an appointment of their Lord
and Master. They absolutely knew his mind and will. They were with
him so long, that it is impossible that they should be ignorant of his
will. When he told them to baptize, they perfectly knew what he
meant. They all practised baptism as a divine appointment. They
baptised all their converts, without one exception, that we find on
sacred record. Their command was, be baptized every one of you in
the name of Jesus Christ for the remission of Sins; and ye shall receive
the gift of the holy Ghost. These were about three thousand, being all
pricked to the heart by Peter’s Sermon, on the day of Pentecost. Now
when they heard this they were pricked in their hearts, or convinced of
Sin and savingly wrought upon, no doubt. And they said unto Peter and
the rest of the Apostles, for they were all together, the Eleven, see Chap.
ii. 1. Men and brethren, what shall we do?—Then Peter said unto them,
repent and be baptized every one of you. This is a command from all
the Apostles; for Peter spake in the name of the rest. They were all of
one opinion on the subject; and this was but a few days after they
received the commission to baptize all that should believe—go teach
all nations, baptizing them. They never differed about the necessity of
baptism. But were perfectly united in their practice. No one of them
ever made any objection to the need of the ordinance, because Christ’s
Religion was a spiritual Religion. Nay, they positively commanded their
converts to receive the ordinance. Acts x. 48. And he commanded them
to be baptized in the name of the Lord Jesus, using, beyond all
reasonable doubt, the very form of words prescribed in the original
institution. Here were both Jews and Gentiles, and one as well as the
other, were commanded to be baptized. Now is it possible for any
candid person, exercising his reason and reflecting powers, and not
determined to support, at all events, a pre-conceived opinion, to
suppose all the Apostles, in all parts of the world, among Jews and
Gentiles, in all the Churches gathered by them, would unitedly,
without one scruple, or one objector or objection, go into the practice
of baptizing with water, if not an institution of their Lord, designed to
be perpetuated, in his Gospel-kingdom, to the end of the world?—The
Gentile converts, who were thousands of miles from Jerusalem and
Judea, and where there were no Jews, were baptized, as well as Jewish
converts. There could be no reason drawn from condescension or
indulgence to prejudices, in their case, whatever there might be, in the
case of Jewish converts.—
The arguments in support of the divine rite of baptism, as a Gospel-
ordinance, would admit of much more illustration and enlargement—
but I pursue the point no further, trusting that the attentive and
reflecting hearer hath received full and entire satisfaction from the
proofs already offered.
After contemplating the scripture-proofs of the ordinance of baptism,
as a standing ordinance in the religion of Jesus Christ, it may not be a
mere waste of time, to consider, in a concise manner, what hath been
objected against it. Plainly as it is instituted, it has nevertheless
been denied.—This, together with the Lord’s Supper, hath been classed
with the old abrogated Jewish rites and ceremonies, and exploded with
them as wholly unworthy the regards of christians, and disgraceful to
the spiritual nature of Christ’s religion. The texts of scripture, which
inform us of the abolition of Jewish rites—meats and drinks—or carnal
ordinances, have been applied to the Gospel-ordinances. The
argument is this, the Apostles tell us no Jewish ordinances are binding
on us, but are all abrogated, therefore there are no christian ordinances
binding on us. This all must see, who can exercise any reason, is no
argument at all. And no man who uses it, can believe it to be any
argument. The passages of scripture which declare the abolition of the
Jewish ordinances are Col. ii. 14, to the 23 verse—Rom. xiv. 1, to the 17
verse. And in several other places the same thing is affirmed. These
places refer only to the Jewish rites and ordinances, and the abolition
of them. Any one may see this, who will attend to them. To apply them
to the christian ordinance of baptism and the Lord’s Supper, is not only
unfair and unjust, but a horrible perversion of scripture. It cannot be
done ignorantly; for any one who can read, and who is capable of
perverting such passages, must know better.——
Again:—The abuses of the ordinance of baptism, and the disputes
about it, are alledged as valid objections against there being any such
ordinance to be observed in the Gospel-kingdom. We lament that it
ever hath been abused or perverted: and that there have been so many
controversies about its nature, and the subject and mode. But this is no
kind of argument against its being a divine ordinance. For can a truth—
a duty—or a doctrine of religion be named, which hath not been
denied, or perverted, or abused?——
Another objection against the holy ordinances of the New-Testament,
baptism and the Lord’s Supper, is taken from our Lord’s washing His
disciples’ feet—Paul’s circumcising Timothy—St. James directing that
the sick be anointed with oil—and the decrees of the first Apostolic
council met at Jerusalem.—These several instances of conduct are
recorded John xiii. 4—to the 12, Acts xvi. 1—to the 4—xv. 29—and
James v. 14. The objection from these things, against the two standing
sacraments or ordinances of the Gospel, baptism and the Lord’s Supper,
is very easily obviated. Our Lord’s washing the feet of his disciples is
described as an extraordinary instance of humility, and is a
representation of the cleansing efficacy of his blood soon to be shed by
wicked hands—calculated to teach us to love one another—to be meek
—ready to do any kind office when needful, though mean—and that
we should not assume any Lordship or dominion over one another’s
consciences. And at the close, he expressly tells them he had set them a
pattern of meekness and condescension, and not ordained an
institution to be observed in his church to the end of the world. There
is a material and essential difference between setting a pattern of a
virtue or giving a remarkable display of it, and solemnly appointing a
holy Ordinance. We cannot argue from the one to the other.—We are to
follow the Redeemer, in all his doctrines and ordinances, but not to
perform the same extraordinary personal actions—any more than to
imitate him in his exterior manner, air, and habit.—As to Paul’s
circumcising Timothy, there was a very plain reason for it. It was
necessary for his reception, at that time, among the Jews. The
ordinance of circumcision was not then declared to be abolished.
When the time had come, when there was to be an open declaration of
its abolition, no one of the Apostles practised it, upon their converts.
Moreover, Timothy was circumcised as born of a Jew, and not as a
christian convert. As a convert to christianity he was baptized, as of
Jewish lineage he was circumcised. And St. Paul’s example to us, in this
is, to exercise condescension, forbearance, and humility. As to the
anointing the sick in the name of the Lord, James v. 14, it was an
appointment for the miraculous cure of such, Mark vi. 13. But since
those extraordinary gifts are ceased, as being no longer necessary for
the confirmation of the Gospel, our faith in the common course of
things has no warrant for using that ceremony; much less doth what is
here said about it, give any countenance to the Papist’s Sacrament of
extreme Unction which they administer not for the recovery of the sick,
but for a pretended purgation from the sins of those that are in the very
article of death, or past hope of recovery.
As to the decrees of the famous Apostolic council met at Jerusalem,
they were adapted to the then existing case and circumstances of the
Gentile converts, and not of perpetual obligation in Christ’s kingdom,
except one article of a moral nature, abstinence from fornication. The
others are not described as binding on all Christians. There is nothing,
in the result of that council, which can possibly signify that the practice
of Christians, in all ages, should be conformed thereto. It was wholly
adapted to the then state of the Gentile Converts.——Thus it most
manifestly appears that these instances of actions above cited and
commented upon, are not binding on Christians, in the common ages
of the Church; and were never intended to be;—nor can any argument
or objection be raised from them, of the least weight or plausibility,
against the two plain, express, and positive Institutions of the
Gospel, to be observed, in all ages, to the end of the world, baptism
and the Lord’s Supper.——
We will now make some improvement of what hath been said.—And
what are the great and special uses or purposes of this Ordinance?
Some affirm that it is a vain and unprofitable ordinance. Let us enquire,
is it so then indeed? Did Jesus Christ impose on his church a rite
useless and absurd?—The profit of it, however, appears to be great
every way. But were we convinced, that he had actually appointed it, we
ought to observe it, even if we could not discern any moral uses, or
religious benefit resulting from it—trusting in his love, faithfulness,
wisdom, and goodness.—It is of great use and importance as it teaches
us, in a striking and affecting manner, our defilement and pollution by
sin, one of the foundation-doctrines of the Christian Religion. It
teaches us this more affectingly than words can do.—It is a clear and
lively emblem of the need of the renewing of the holy Ghost. Baptismal
water points out the need of a spiritual baptism—or that we must be
cleansed from sin by grace divine, and a Saviour’s atoning blood.—The
very form of words prescribed by our Lord, and always used, teach us
where all our hope, our love, our trust, our dependence for salvation
must center, in the Father, and the son, and the holy Ghost—a triune
God. Baptismal water, as a visible sign, represents our need of having
all our sins, as to their guilt, washed away by the blood of Jesus—Be
baptized every one of you, in the name of Jesus Christ, for the remission
of sins.—Baptism, as a sensible sign, signifies our obligation to
renounce sin, and to put on the temper and character of Christ—to put
away the filth of the flesh, and to put on newness of life—to renounce
the vanity and pomp of the world—and to become clean in heart and
life. And when we are baptized, or have our children baptized, we bind
ourselves to love, to live to, to obey, and serve the one true God as set
forth in his own word.—Can the ordinance, then, be useless?—Does it
answer no important ends, no moral and religious purposes?—Is it also
recognizing our engagements to be the Lord’s we and ours. And
teaches some of the greatest and most important doctrines, truths, and
duties of Religion.—Does it then, as the deniers of it affirm, keep us
from god—from christ—from the substance—from the power
of religion?—No: it brings us, in its tendency, to them. How unhappy
that any, under a christian name, should set themselves to vilify—
reproach, and deny, it!—May the scales of ignorance and prejudice fall
speedily from their eyes; and that Jesus whose ordinances they reject,
commiserate and forgive them; and not suffer them to be the means of
spreading irreligion!—
2dly. We may enquire for the improvement of this subject, who may,
according to scripture, enjoy the ordinance of baptism? The answer is,
all who confess that Jesus is the Christ—who profess to believe in his
religion—and have a desire and disposition to honour him in it,—and
live a regular, pious and religious life. Such may enjoy it for themselves,
and infant seed.——
3dly. As another observation for the improvement of the subject, we
may ask how is it to be administered? Water is to be applied to the
subject by sprinkling the face, or by immersion, in the name of the
father, son, and holy Ghost. The quantity of water is a mere
circumstance. And immersion is as valid as sprinkling.—Mere
circumstances are left to the wisdom, prudence, and convenience of
the observer. Some prefer immersion as the most scriptural, and
others, sprinkling. Both are valid. Both are right? All that is essential is
the application of water, in one of these ways, to the meet subject, as
the form is prescribed. Some admit, others exclude infants, but this
need be no bar to christian communion. Had the various
denominations of christians entertained these catholic and charitable
sentiments, there would never have been any dispute about the mode,
and much evil would have been prevented.—I hope and expect the day
will come—and O that it might not be far distant, when these
reconciling and compromising sentiments will have a general diffusion;
when all real christians will be united, though practising in different
forms, and bend their whole force and zeal against error—vice—and
irreligion.
4thly. Let all Christians feel a due and unshaken attachment to public
worship, the Sabbath—and all divine ordinances. All of them ought to
be dear to Christ’s disciples. We should esteem them. We should love
them. We should diligently and constantly attend unto them. We are,
at the same time, to take care that we do not place our hope in, or
dependence on them, instead of the God of ordinances, the Saviour’s
all-cleansing blood, and the spirit’s sanctifying operations. Means and
ordinances are the helps provided by a wise, gracious, and holy God. In
the appointment of them we see, in a most wonderful manner, his love
and grace, goodness and patience, wisdom and condescension. Let our
eye, then, be to the God of grace to bless and sanctify unto us, all
means and ordinances. By the power of the holy Ghost we are; and we
must be renewed. But we ought nevertheless to prize and esteem all
divine institutions, as means of holiness and pious instruction. We
should be grieved when any neglect them, revile them, or deny them.
For they are the ways prescribed by God, to uphold religion, in the
world, amid the floods of error, ignorance, fanaticism, and infidelity,
which threaten the existence of all serious godliness.
5thly. We hence infer the duty of all people to prepare themselves
without delay, to enjoy the ordinance of baptism. It is a precious
ordinance. It is divinely appointed to teach us, the great truths of
Religion, and to help forward our salvation. All parents should see that
they lose no time in preparing to enjoy it for themselves, if unbaptized,
and for their Children. And what, my dear friends, is required of you, is
to seek and know God:—to desire to do your duty: to honor your Maker
and Redeemer in the ways, which he has so clearly appointed.—Permit
me with all tenderness and affection as a Minister of Jesus Christ to
urge you to give no rest to yourselves, till you have rendered yourselves
meet for the enjoyment of Gospel-ordinances.—How mournful is the
idea that so many, in our Land, live in the total neglect of this holy
sacrament of baptism.—Unbaptized Children! Unbaptized Parents!
Unbaptized Youth!—How affecting the thought to all the lovers of
Gospel-ordinances.—What impiety prevails!—what neglect of religion
in general—of prayer in families in particular, and of public worship.—
Will not a holy and righteous God visit for these things?—Many boast
of this, as the age of reason—of our land, as the land of reason—and
talk of the complete downfall of superstition, and bless themselves, at
the thought of the diffusion of sceptical principles, and are as zealous
to propagate irreligion, error, and infidelity, as if the salvation of our
country, their own salvation, and the salvation of others depended on
the abolition of christianity, against which the most virulent attacks are
made, under the name of superstition, or a sectarian religion.—
But some seriously inclined people are objecting, perhaps, and saying
we wish to enjoy divine ordinances, but you have made the way too
strict, more so, than God has made it, in his holy word.—Consider a
moment, before you draw up a conclusion so unfounded, and so much
to your disadvantage. All that is required of you, is to give yourselves up
to God and the duties of Religion.—Can less be required? Can any
lower terms be rationally desired? We must never profane an
ordinance, or prostitute and abuse it to worldly designs and ends.—
Often, alas! have this, and the ordinance of the Lord’s supper been
perverted and profaned; and so have the holy Oracles of God, which
are the only Oracles of reason, and of eternal truth, and of all religion.
Let us see that we are not among the number of those, who profane
and abuse, or neglect and forsake it.—Come, then, and take the vows
of the Lord upon you, and give yourselves up to the duties of our holy
Religion, and enjoy all its ordinances and special privileges.—Defer not
—procrastinate no longer the concerns of your souls and of Salvation.
—Behold now is the accepted time! Behold now is the day of Salvation!
To-day, if ye will hear his voice. There may be no to-morrow for you—
no more time—no more seasons of grace. A small space of time will
end all your days, and open to us an everlasting state.—Hear, then, the
call of God, of reason, of virtue, and of Religion. Delay:—O! delay no
longer. Come and take Christ’s yoke upon you, and learn of him, for he
is meek and lowly in heart, and ye shall have rest unto your souls.
6thly. For what hath been said, let all who have enjoyed the ordinance
of baptism, feel the sacred bonds thereof, and seek divine grace to
enable them to live up to their baptismal vows. Let parents who have
come forward and had baptism for their Children, and have devoted
them, therein, to God, to be his, and for him, bring them up in the
ways of Religion—teach them to pray—and pray with, and for them in
their houses:—instruct and govern them for God—set a pious example
before them—and teach them their baptismal dedication—the
meaning and import of it, as above explained, and as a peculiar
privilege binding them to be the Lord’s.—And let such parents, farther
examine their own hearts and ways, and see if they gave up their
Children, in the baptismal dedication, in outward appearance only, or
in sincerity and in truth, hoping and trusting in God’s mercy and truth
for them.—And let parents who never prepared themselves to bring
their Children to God, in baptism, when they look on their dear infant
flock, feel a deep sense of their sin, in the neglect of their duty to them:
and so pity, and so love them, as to come forward, and give them up to
God in baptism.—And Let unbaptized youth realize their duty, and
never give themselves rest, till they have dedicated themselves to God,
in his covenant and baptismal institution, to be his in life, his in death,
and his forever.——And let the whole Congregation that now hear me,
old and young, esteem, rightly improve, and highly value all the
institutions of the Christian Religion; endeavour, by all the light and
advantages, which you enjoy, truly to understand them:—to place
them on their proper foundation; and to look to the God of all grace,
for his powerful, purifying, and all-cleansing influence, and to Jesus
Christ that the guilt of sin may be washed away:—and make it your
grand concern to walk in all the commandments and ordinances of the
Lord, blameless.
D I S CO U R S E XI.
D I S CO U R S E XII.
ebookmasss.com