Learn to write DAX a practical guide to learning Power Pivot for Excel and Power BI by Allington, Matt.pdf

(6905 KB) Pobierz
inside front cover - page intentionally left blank
Learn to Write DAX
A Practical Guide to Learning Power Pivot for Excel and
Power BI
by
Matt Allington
Holy Macro! Books
PO Box 541731
Merritt Island, FL 32953
Learn to Write DAX
© 2016 Tickling Keys, Inc.
All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information or storage retrieval sys-
tem without permission from the publisher. Every effort has been made to make this book as complete and
accurate as possible, but no warranty or fitness is implied. The information is provided on an "as is" basis.
The authors and the publisher shall have neither liability nor responsibility to any person or entity with re-
spect to any loss or damages arising from the information contained in this book.
Author: Matt Allington
Layout: Jill Bee
Copyediting: Kitty Wilson
Cover Design: Madeline Allington & Shannon Mattiza
Indexing: Nellie Jay
Image: Pressmaster/Shutterstock.com
Published by: Holy Macro! Books, PO Box 541731, Merritt Island FL 32953, USA
Distributed by: Independent Publishers Group, Chicago, IL
First Printing: November, 2015
ISBN: 978-1-61547-041-9 Print, 978-1-61547-231-4 PDF, 978-1-61547-354-0 ePub, 978-1-61547-131-7 Mobi
LCCN: 2015940635
ii
iii
Table of Contents
1: Concept: Pivot Tables vs. Power Pivot..............................................................................................3
2: Concept: Loading Data.....................................................................................................................5
3: Concept: Calculated Fields .............................................................................................................24
4: DAX Topic: SUM(), COUNT(), COUNTROWS(), MIN(), MAX(), COUNTBLANK(), and DIVIDE()............34
5: Concept: Filter Propagation
...........................................................................................................51
6: DAX Topic: The Basic Iterators
SUMX()
and
AVERAGEX()
.....................................................................57
7: DAX Topic: Calculated Columns......................................................................................................66
8: DAX Topic:
CALCULATE()
.......................................................................................................................69
9: Concept: Evaluation Context and Context Transition
......................................................................76
10: DAX Topic:
IF(), SWITCH(),
and
FIND()
................................................................................................80
11: DAX Topic:
VALUES()
and
HASONEVALUE()
.........................................................................................83
12: DAX Topic:
ALL(), ALLEXCEPT(),
and
ALLSELECTED()
...........................................................................90
13: DAX Topic:
FILTER()
...........................................................................................................................103
14: DAX Topic: Time Intelligence ......................................................................................................112
15: DAX Topic:
RELATED()
and
RELATEDTABLE()
.....................................................................................135
16: Concept: Disconnected Tables ...................................................................................................139
17: Concept: KPIs and Multiple Data Tables
.....................................................................................149
18: Concept: Cube Formulas ............................................................................................................160
19: Moving from Excel to Power BI
..................................................................................................166
20: Next Steps on Your DAX Journey
................................................................................................173
Appendix A: Answers to Practice Exercises
......................................................................................175
Index .......................................................................................................................................................182
Zgłoś jeśli naruszono regulamin