Beginning Microsoft Power BI: A Practical Guide to Self-Service Data Analytics 3rd Edition Dan Clark download
Beginning Microsoft Power BI: A Practical Guide to Self-Service Data Analytics 3rd Edition Dan Clark download
https://ebookmeta.com/product/beginning-microsoft-power-bi-a-
practical-guide-to-self-service-data-analytics-3rd-edition-dan-
clark/
https://ebookmeta.com/product/beginning-microsoft-power-bi-a-
practical-guide-to-self-service-data-analytics-3rd-edition-dan-
clark-2/
https://ebookmeta.com/product/beginning-power-bi-2nd-edition-dan-
clark/
https://ebookmeta.com/product/applied-microsoft-power-bi-bring-
your-data-to-life-7th-edition-teo-lachev/
https://ebookmeta.com/product/a-critical-account-of-
article-1062-tfeu-government-failure-in-public-service-
provision-1st-edition-jarleth-burke/
Insiders Guide to Williamsburg And Virginia s Historic
Triangle 17th Edition Susan Corbett
https://ebookmeta.com/product/insiders-guide-to-williamsburg-and-
virginia-s-historic-triangle-17th-edition-susan-corbett/
https://ebookmeta.com/product/principles-of-superconducting-
quantum-computers-1st-edition-daniel-d-stancil/
https://ebookmeta.com/product/ceh-v11-certified-ethical-hacker-
version-11-practice-tests-2nd-edition-messier/
https://ebookmeta.com/product/the-laboratory-guinea-pig-
laboratory-animal-pocket-reference-2nd-edition-clemons-donna-j-
seeman-jennifer-l/
https://ebookmeta.com/product/iraq-the-ancient-sites-iraqi-
kurdistan-3rd-edition-geoff-hann/
Diagnosis and Treatment of Fungal Infections 3rd
Edition Duane R. Hospenthal
https://ebookmeta.com/product/diagnosis-and-treatment-of-fungal-
infections-3rd-edition-duane-r-hospenthal/
Beginning
Microsoft
Power BI
A Practical Guide to
Self-Service Data Analytics
—
Third Edition
—
Dan Clark
Beginning Microsoft
Power BI
A Practical Guide to Self-Service
Data Analytics
Third Edition
Dan Clark
Beginning Microsoft Power BI: A Practical Guide to Self-Service Data Analytics
Dan Clark
Camp Hill, PA, USA
Introduction�������������������������������������������������������������������������������������������������������������xv
iii
Table of Contents
iv
Table of Contents
v
Table of Contents
Chapter 11: Data Analysis with Pivot Tables and Charts�������������������������������������� 277
Pivot Table Fundamentals��������������������������������������������������������������������������������������������������������� 278
Slicing the Data������������������������������������������������������������������������������������������������������������������������� 280
Adding Visualizations to a Pivot Table��������������������������������������������������������������������������������������� 284
Working with Pivot Charts��������������������������������������������������������������������������������������������������������� 288
Using Multiple Charts and Tables���������������������������������������������������������������������������������������������� 291
Using Cube Functions��������������������������������������������������������������������������������������������������������������� 294
Summary���������������������������������������������������������������������������������������������������������������������������������� 304
vi
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 403
vii
About the Author
Dan Clark is a senior business intelligence (BI) and
programming consultant specializing in Microsoft
technologies. He is focused on learning new BI and
data technologies and training others on how to best
implement the technology. Dan has published several
books and numerous articles on .NET programming and BI
development. He is a regular speaker at various developer
and database conferences and user group meetings and
enjoys interacting with the Microsoft communities. In a
previous life, Dan was a physics teacher. He is still inspired by the wonder and awe of
studying the universe and figuring out why things behave the way they do. Dan can be
reached at [email protected].
ix
About the Technical Reviewer
Al MacKinnon is a principal customer success manager with
CDW, focusing on Microsoft Cloud solutions with customers
in the Mid-Atlantic region. He has a long background in IT,
including 10 years with Microsoft. That experience includes
technical training, consulting, project management,
solutions architecture, and course development. He’s
held numerous certifications from Novell, Microsoft, and
CompTIA and has been a CISSP since 2003. He gets the most
satisfaction from helping organizations map technology to
business goals and challenges. Al is supported by his wife of
over 30 years, and, when not working, he often discusses our place in the universe with
the author. Finally, he’s gratified that his BA in English is finally starting to pay off.
xi
Acknowledgments
Once again, thanks to the team at Apress for making the writing of this book an enjoyable
experience. A special thanks goes to my good friend and technical reviewer, Al—thank
you for your attention to detail and excellent suggestions while reviewing this book.
xiii
Introduction
Self-service business intelligence (BI)—you have heard the hype, seen the sales demos,
and are ready to give it a try. Now what? You have probably checked out a few web sites
for examples, given them a try, and learned a thing or two, but you are probably still left
wondering how all the pieces fit together and how you go about creating a complete
solution. If so, this book is for you. It takes you step by step through the process of
analyzing data using the tools that are at the core of Microsoft’s self-service BI offering:
Power Query and Power BI Desktop.
Quite often, you need to take your raw data and transform it in some way before
you load it into the data model. You may need to filter, aggregate, or clean the raw data.
I show you how Power Query allows you to easily transform and refine data before
incorporating it into your data model. Next, I show you how to create robust, scalable
data models using Power BI Desktop. Because creating robust Power BI models is
essential to creating self-service BI solutions, I cover it extensively in this book. Next up,
I show you how to use Power BI Desktop to easily build interactive visualizations that
allow you to explore your data to discover trends and gain insight. Finally, I show you
how to deploy your solution to the Power BI Service for your colleagues to use.
I strongly believe that one of the most important aspects of learning is doing. You
can’t learn how to ride a bike without jumping on a bike, and you can’t learn to use the
BI tools without actually interacting with them. Any successful training program includes
both theory and hands-on activities. For this reason, I have included a hands-on activity
at the end of every chapter designed to solidify the concepts covered in the chapter.
I encourage you to work through these activities diligently. It is well worth the effort.
As you start working with Power BI, you will soon realize it is constantly evolving (for
the better). Every month there is an update to Power BI Desktop that introduces new
features and changes to the interface. For this reason, some of the screenshots may not
look exactly like the current version of Power BI. They will be, however, close enough to
figure out what has changed.
Good luck on your journey, and don’t hesitate to provide feedback and suggestions
for improving the experience!
xv
CHAPTER 1
Introducing Power BI
The core of Microsoft’s self-service business intelligence (BI) toolset is the Power BI
data engine (also known as Power Pivot). It is integrated into both Power BI Desktop
and Excel (2010 and later) and forms the foundation on top of which you will build your
analytical reports and dashboards. This chapter provides you with some background
information on why Power BI is such an important tool and what makes it perform so
well. The chapter also provides you with an overview of the Power BI Desktop interface
and gives you some experience using the different areas of the interface.
After reading this chapter, you will be familiar with the following:
• Why you should use Power Pivot
• The xVelocity in-memory analytics engine
• Exploring the Power BI Desktop interface
• Analyzing data in a Power BI report
What is needed is a solution that allows for agile data analysis without so much
reliance on IT and formalized processes. To solve these problems, many business analysts
have used Excel to create pivot tables and perform ad hoc analysis on sets of data gleaned
from various data sources. Some problems with using isolated Excel workbooks for
analysis are conflicting versions of the truth, silos of data, and data security.
So how can you solve this dilemma of the centralized data warehouse being too rigid
while the Excel solution is too loose? This is where Microsoft’s self-service BI toolset
comes in. These tools do not replace your centralized data warehouse solution but rather
augment it to promote agile data analysis. Using Power BI, you can pull data from the
data warehouse, extend it with other sources of data such as text files or web data feeds,
build custom measures, and analyze the data using powerful visuals to gain insight into
the data. You can create quick proofs of concepts that can be easily promoted to become
part of the enterprise-wide solution. Power BI also promotes one-off data analysis
projects without the overhead of a drawn-out development cycle. When combined
with the Power BI Service portal, reports and dashboards can be shared, secured, and
managed. This goes a long way to satisfying IT’s need for governance without impeding
the business user’s need for agility.
Here are some of the benefits of Power BI:
• Power BI Desktop is a free tool for creating reports.
• Easily integrates data from a variety of sources.
• Handles large amounts of data, upward of tens to hundreds of
millions of rows.
• Includes a powerful Data Analysis Expressions (DAX) language.
• Has data in the model that is read-only, which increases security and
integrity.
When Power BI reports are hosted in the Power BI Service portal, some added
benefits are
• Enables sharing and collaboration
• Scheduling and automation of data refresh
• Can audit changes through version management
• Can secure users for read-only and updateable access
Now that you know some of the benefits of Power BI, let’s see what makes it tick.
2
Chapter 1 Introducing Power BI
3
Another Random Scribd Document
with Unrelated Content
PERSEVERANCE AGAINST FORTUNE.—A Story.
EVENING XXV.
THE PRICE OF A VICTORY.
“Be sure, Frederick, always keep good company,” was the final
admonition of Mr. Lofty, on dismissing his son to the University.
“I entreat you, Henry, always to choose good company,” said Mr.
Manly, on parting with his son to an apprenticeship in a
neighbouring town.
But it was impossible for two people to mean more differently by the
same words.
In Mr. Lofty’s idea, good company was that of persons superior to
ourselves in rank and fortune. By this alone he estimated it: and the
degrees of comparison, better and best, were made exactly to
correspond to such a scale. Thus, if an esquire was good company, a
baronet was better, and a lord best of all, provided that he was not
a poor lord, for in that case, a rich gentleman might be at least as
good. For as, according to Mr. Lofty’s maxim, the great purpose for
which companions were to be chosen was to advance a young man
in the world by their credit and interest, those were to be preferred
who afforded the best prospects in this respect.
Mr. Manly, on the other hand, understood by good company, that
which was improving to the morals and understanding; and by the
best, that which, to a high degree of these qualities, added true
politeness of manners. As superior advantages in education to a
certain point accompany superiority of condition, he wished his son
to prefer as companions those whose situation in life had afforded
them the opportunity of being well educated; but he was far from
desiring him to shun connexions with worth and talents, wherever
he should find them.
Mr. Lofty had an utter aversion to low company, by which he meant
inferiors, people of no fashion and figure, shabby fellows whom
nobody knows.
Mr. Manly equally disliked low company, understanding by it persons
of mean habits and vulgar conversation.
A great part of Mr. Manly’s good company was Mr. Lofty’s low
company; and not a few of Mr. Lofty’s very best company were Mr.
Manly’s very worst.
Each of the sons understood his father’s meaning, and followed his
advice.
Frederick, from the time of his entrance at the University,
commenced what is called a tuft-hunter, from the tuft in the cap
worn by young noblemen. He took pains to insinuate himself into the
good graces of all the young men of high fashion in his college, and
became a constant companion in their schemes of frolic and
dissipation. They treated him with an insolent familiarity, often
bordering upon contempt; but following another maxim of his father,
“one must stoop to rise,” he took it all in good part. He totally
neglected study as unnecessary, and indeed inconsistent with his
plan. He spent a great deal of money, with which his father, finding
that it went in good company, at first supplied him freely. In time,
however, his expenses amounted to so much, that Mr. Lofty, who
kept good company too, found it difficult to answer his demands. A
considerable sum that he lost at play with one of his noble friends
increased the difficulty. If it were not paid, the disgrace of not
having discharged a debt of honour would lose him all the favour he
had acquired; yet the money could not be raised without greatly
embarrassing his father’s affairs.
In the midst of this perplexity, Mr. Lofty died, leaving behind him a
large family, and very little property. Frederick came up to town, and
soon dissipated in good company the scanty portion that came to his
share. Having neither industry, knowledge, nor reputation, he was
then obliged to become an humble dependant on the great,
flattering all their follies, and ministering to their vices, treated by
them with mortifying neglect, and equally despised and detested by
the rest of the world.
Henry, in the meantime, entered with spirit into the business of his
new profession, and employed his leisure in cultivating an
acquaintance with a few select friends. These were partly young
men in a situation similar to his own, partly persons already settled
in life, but all distinguished by propriety of conduct and improved
understandings. From all of them he learned something valuable,
but he was more particularly indebted to two of them, who were in a
station of life inferior to that of the rest. One was a watchmaker, an
excellent mechanic and tolerable mathematician, and well
acquainted with the construction and use of all the instruments
employed in experimental philosophy. The other was a young
druggist, who had a good knowledge of chymistry, and frequently
employed himself in chymical operations and experiments. Both of
them were men of very decent manners, and took a pleasure in
communicating their knowledge to such as showed a taste for
similar studies. Henry frequently visited them, and derived much
useful information from their instructions, for which he ever
expressed great thankfulness. These various occupations and good
examples effectually preserved him from the errors of youth, and he
passed his time with credit and satisfaction. He had the same
misfortune with Frederick, just as he was ready to come out into the
world, of losing his father, upon whom the support of the family
chiefly depended; but in the character he had established, and the
knowledge he had acquired, he found an effectual resource. One of
his young friends proposed to him a partnership in a manufactory he
had just set up at considerable expense, requiring for his share only
the exertion of his talents and industry. Henry accepted the offer,
and made such good use of the skill in mechanics and chymistry he
had acquired, that he introduced many improvements into the
manufactory, and rendered it a very profitable concern. He lived
prosperous and independent, and retained in manhood all the
friendships of his youth.
THE WANDERER’S RETURN.
It was a delightful evening about the end of August. The sun, setting
in a pure sky, illuminated the tops of the western hills, and tipped
the opposite trees with a yellow lustre.
A traveller, with sunburnt cheeks and dusty feet, strong and active,
having a knapsack at his back, had gained the summit of a steep
ascent, and stood gazing on the plain below.
This was a wide tract of champaign country, checkered with villages,
whose towers and spires peeped above the trees in which they were
embosomed. The space between them was chiefly arable land, from
which the last products of the harvest were busily carrying away.
A rivulet wound through the plain, its course marked with gray
willows. On its banks were verdant meadows, covered with lowing
herds, moving slowly to the milkmaids, who came tripping along
with pails on their heads. A thick wood clothed the side of a gentle
eminence rising from the water, crowned with the ruins of an ancient
castle.
Edward (that was the traveller’s name) dropped on one knee, and
clasping his hands, exclaimed, “Welcome, welcome, my dear native
land. Many a sweet spot have I seen since I left thee, but none so
sweet as thou! Never has thy dear image been out of my memory;
and now with what transport do I retrace all thy charms! O, receive
me again, never more to quit thee!” So saying, he threw himself on
the turf; and having kissed it, rose and proceeded on his journey.
As he descended into the plain, he overtook a little group of
children, merrily walking along the path, and stopping now and then
to gather berries in the hedge.
“Where are you going, my dears?” said Edward.
“We are going home,” they all replied.
“And where is that?”
“Why, to Summerton, that town there among the trees, just before
us. Don’t you see it?”
“I see it well,” answered Edward, the tear standing in his eye.
“And what is your name—and yours—and yours?”
The little innocents told their names. Edward’s heart leaped at the
well-known sounds.
“And what is your name, my dear?” said he to a pretty girl,
somewhat older than the rest, who hung back shyly, and held the
hand of a ruddy, white-headed boy, just breeched.
“It is Rose Walsingham, and this is my younger brother, Roger.”
“Walsingham!” Edward clasped the girl round the neck, and
surprised her with two or three very close kisses. He then lifted up
little Roger, and almost devoured him. Roger seemed as if he wanted
to be set down again, but Edward told him he would carry him
home.
“And can you show me the house you live at, Rose?” said Edward.
“Yes—it is just there, beside the pond, with the great barn before it,
and the orchard behind.”
“And will you take me home with you, Rose?”
“If you please,” answered Rose, hesitatingly.
They walked on; Edward said but little, for his heart was full, but he
frequently kissed little Roger.
Coming at length to a stile from which a path led across a little
close, “This is the way to our house,” said Rose.
The other children parted. Edward set down Roger, and got over the
stile. He still, however, kept hold of the boy’s hand. He trembled,
and looked wildly around him.
When they approached the house, an old mastiff came running to
meet the children. He looked up at Edward rather sourly, and gave a
little growl; when all at once his countenance changed; he leaped
upon him, licked his hand, wagged his tail, murmured in a soft voice,
and seemed quite overcome with joy. Edward stooped down, patted
his head, and cried, “Poor Captain, what! are you alive, yet?” Rose
was surprised that the stranger and their dog should know one
another.
They all entered the house together. A good-looking middle-aged
woman was busied in preparing articles of cookery, assisted by her
grown-up daughter. She spoke to the children as they came in, and
casting a look of some surprise on Edward, asked him what his
business was.
Edward was some time silent; at length, with a faltering voice, he
cried, “Have you forgot me, mother?”
“Edward! my son Edward!” exclaimed the good woman. And they
were instantly locked in each other’s arms.
“My brother Edward!” said Molly; and took her turn for an embrace,
as soon as her mother gave her room.
“Are you my brother?” said Rose.
“That I am,” replied Edward, with another kiss. Little Roger looked
hard at him, but said nothing.
News of Edward’s arrival soon flew across the yard, and in came
from the barn his father, his next brother, Thomas, and the third,
William. The father fell on his neck, and sobbed out his welcome and
blessing. Edward had not hands enough for them all to shake.
An aged, white-headed labourer came in, and held out his shrivelled
hand. Edward gave it a hearty squeeze. “God bless you,” said old
Isaac; “this is the best day I have seen this many a year.”
“And where have you been this long while?” cried the father. “Eight
years and more,” added the mother.
His elder brother took off his knapsack; and Molly drew him a chair.
Edward seated himself, and they all gathered round him; the old dog
got within the circle and lay at his feet.
“O, how glad I am to see you all again!” were Edward’s first words.
“How well you look, mother! but father grows thinner. As for the
rest, I should have known none of you, unless it had been Thomas
and old Isaac.”
“What a sunburnt face you have got!—but you look brave and
hearty,” cried his mother.
“Ay, mother, I have been enough in the sun, I assure you. From
seventeen to five-and-twenty I have been a wanderer upon the face
of the earth, and I have seen more in that time than most men in
the course of their lives.
“Our young landlord, you know, took such a liking to me at school,
that he would have me go with him on his travels. We went through
most of the countries of Europe, and at last to Naples, where my
poor master took a fever and died. I never knew what grief was till
then; and I believe the thoughts of leaving me in a strange country
went as much to his heart as his illness. An intimate acquaintance of
his, a rich young West Indian, seeing my distress, engaged me to go
with him in a voyage he was about to make to Jamaica. We were too
short a time in England before we sailed, for me to come and see
you first, but I wrote you a letter from the Downs.”
“We never received it,” said his father.
“That was a pity,” returned Edward; “for you must have concluded I
was either dead or had forgotten you. Well—we arrived safe in the
West Indies, and there I stayed till I had buried that master, too; for
young men die fast in that country. I was very well treated, but I
could never like the place; and yet Jamaica is a very fine island, and
has many good people in it. But for me, used to see freemen work
cheerfully along with their masters—to behold nothing but droves of
black slaves in the fields, toiling in the burning sun, under the
constant dread of the lash of hard-hearted task-masters—it was
what I could not bring myself to bear; and though I might have
been made an overseer of a plantation, I chose rather to live in a
town, and follow some domestic occupation. I could soon have got
rich there; but I fell into a bad state of health, and people were
dying all round me of the yellow fever; so I collected my little
property, and though a war had broken out, I ventured to embark
with it for England.
“The ship was taken, and carried into the Havana, and I lost my all
and my liberty besides. However, I had the good fortune to
ingratiate myself with a Spanish merchant whom I had known at
Jamaica, and he took me with him to the continent of South
America. I visited great part of this country, once possessed by
flourishing and independent nations, but now groaning under the
severe yoke of their haughty conquerers. I saw those famous gold
and silver mines, where the poor natives worked naked, for ever
shut out from the light of day, in order that the wealth of their
unhappy land may go to spread luxury and corruption throughout
the remotest regions of Europe.
“I accompanied my master across the great southern ocean, a
voyage of some months, without the sight of anything but water and
sky. We came to the rich city of Manilla, the capital of the Spanish
settlements in those parts. There I had my liberty restored, along
with a handsome reward for my services. I got thence to China; and
from China to the English settlements in the East Indies, where the
sight of my countrymen, and the sounds of my native tongue, made
me fancy myself almost at home again, though still separated by half
the globe.
“Here I saw a delightful country, swarming with industrious
inhabitants, some cultivating the land, others employed in
manufactures, but of so gentle and effeminate a disposition, that
they have always fallen under the yoke of their invaders. Here how
was I forced to blush for my countrymen, whose avarice and
rapacity so often have laid waste this fair land, and brought on it all
the horrors of famine and desolation! I have seen human creatures
quarrelling like dogs for bare bones thrown upon a dunghill. I have
seen fathers selling their families for a little rice, and mothers
entreating strangers to take their children for slaves, that they might
not die of hunger. In the midst of such scenes I saw pomp and
luxury of which our country affords no examples.
“Having remained here a considerable time, I gladly at length set my
face homeward, and joined a company who undertook the long and
perilous journey to Europe over land. We crossed vast tracts both
desert and cultivated; sandy plains parched with heat and drought,
and infested with bands of ferocious plunderers. I have seen a well
of muddy water more valued than ten camel-loads of treasure; and
a few half-naked horsemen strike more terror than a king with all his
guards. At length, after numberless hardships and dangers, we
arrived at civilized Europe, and forgot all we had suffered. As I came
nearer my native land, I grew more and more impatient to reach it;
and when I had set foot on it, I was still more restless till I could see
again my beloved home.
“Here I am at last—happy in bringing back a sound constitution and
a clear conscience. I have also brought enough of the relics of my
honest gains to furnish a little farm in the neighbourhood, where I
mean to sit down and spend my days in the midst of those whom I
love better than all the world besides.”
When Edward had finished, kisses and kind shakes of the hand were
again repeated, and his mother brought out a large slice of harvest-
cake, with a bottle of her nicest currant-wine, to refresh him after his
day’s march. “You are come,” said his father, “at a lucky time, for this
is our harvest-supper. We shall have some of our neighbours to
make merry with us, who will be almost as glad to see you as we
are—for you were always a favourite among them.”
It was not long before the visiters arrived. The young folks ran out
to meet them, crying, “Our Edward’s come back—our Edward’s come
home! Here he is—this is he;” and so without ceremony they
introduced them.
“Welcome!—welcome!—God bless you!” sounded on all sides.
Edward knew all the elderly ones at first sight, but the young people
puzzled him for awhile. At length he recollected this to have been his
schoolfellow, and that his companion in driving plough; and he was
not long in finding out his favourite and playfellow Sally, of the next
farmhouse, whom he left a romping girl of fifteen, and now saw a
blooming full-formed young woman of three-and-twenty. He
contrived in the evening to get next her: and though she was
somewhat reserved at first, they had pretty well renewed their
intimacy before the company broke up.
“Health to Edward, and a happy settlement among us!” was the
parting toast. When all were retired, the Returned Wanderer went to
rest in the very room in which he was born, having first paid fervent
thanks to Heaven for preserving him to enjoy a blessing the dearest
to his heart.