Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Extending Power BI with Python and R
Extending Power BI with Python and R

Extending Power BI with Python and R: Perform advanced analysis using the power of analytical languages , Second Edition

eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Extending Power BI with Python and R

Where and How to Use R and Python Scripts in Power BI

Power BI is Microsoft’s flagship self-service business intelligence product. It consists of a set of on-premises applications and cloud-based services that help organizations integrate, transform, and analyze data from a wide variety of source systems through a user-friendly interface.

The platform is not limited to data visualization. Power BI is much more than this when you consider that its analytics engine (Vertipaq) is the same as SQL Server Analysis Services (SSAS), Azure Analysis Services, and Power Pivot in Excel and it is also the engine used for reports and datasets published to the Power BI service. In addition, it uses Power Query as its data extraction and transformation engine, which we find in both Analysis Services and Excel. The engine comes with a very powerful and versatile formula language (M) and GUI, thanks to which you can “grind” and shape any type of data into any form.

Moreover, Power BI supports DAX as a data analytics formula language, which can be used for advanced calculations and queries on data that has already been loaded into tabular data models.

Such a versatile and powerful tool is a godsend for anyone who needs to do data ingestion and transformation in order to build dashboards and reports to summarize a company’s business.

Recently, the availability of huge amounts of data, along with the ability to scale the computational power of machines, has made the area of advanced analytics more appealing. So, new mathematical and statistical tools have become necessary in order to provide rich insights. Hence the integration of analytical languages such as Python and R within Power BI.

R or Python scripts can only be used within Power BI with specific features. Knowing which Power BI tools can be used to inject R or Python scripts into Power BI is key to understanding whether the problem you want to address is achievable with these analytical languages.

This chapter will cover the following topics:

  • Injecting R or Python scripts into Power BI
  • Using R and Python to interact with your data
  • Python and R compatibility across Power BI products

Technical requirements

This chapter requires you to have Power BI Desktop already installed on your machine (you can download it here: https://aka.ms/pbiSingleInstaller). The version used in this chapter is 2.110.1161.0 64-bit (October 2022).

Injecting R or Python scripts into Power BI

In this first section, Power BI Desktop tools that allow you to use Python or R scripts will be presented and described in detail. Specifically, you will see how to add your own code during the data loading, data transforming, and data viewing phases.

Data loading

One of the first steps required to work with data in Power BI Desktop is to import it from external sources:

There are many connectors that allow you to do this, depending on the respective data sources, but you can also do it via scripts in Python and R. In fact, if you click on the Get data icon in the ribbon, not only are the most commonly used connectors shown but you can also select other ones from a more complete list by clicking on More...:

Graphical user interface, text, application  Description automatically generated

Figure 1.1: Browse more connectors to load your data

In the new Get Data window that pops up, simply start typing the word script into the search box, and immediately the two options for importing data via Python or R appear:

Figure 1.2 – Showing R script and Python script into the Get Data window

Figure 1.2: Showing R script and Python script in the Get Data window

Reading the contents of the tooltip, obtained by hovering the mouse over the Python script option, two things should immediately jump out at you:

  1. A local installation of Python is required.
  2. What can be imported through Python is a data frame.

The same two observations also apply when selecting R script. The only difference is that it is possible to import a pandas DataFrame when using Python (a DataFrame is a data structure provided by the pandas package), whereas R employs the two-dimensional array-like data structure called an R data frame, which is provided by default by the language.

After clicking on the Python script option, a new window will be shown containing a text box for writing the Python code:

Figure 1.3 – Window showing the Python script editor

Figure 1.3: Window showing the Python script editor

As you can see, it’s definitely a very skimpy editor, but in Chapter 3, Configuring Python with Power BI, you’ll discover how you can utilize your preferred IDE to create your scripts within a more comprehensive and feature-rich editor.

Taking a look at the warning message, Power BI reminds you that no Python engine has been detected, so it must be installed. If you already have Python installed and configured, you will not see this message. Clicking on the How to install Python link will cause a Microsoft Docs web page to open, explaining the steps to install Python.

Microsoft suggests installing the base Python distribution, but in order to follow some best practices on environments (self-contained spaces that allow developers to manage dependencies, libraries, and configurations specific to individual projects), we will install the Miniconda distribution. The details of how to do this and why will be covered in Chapter 3.

If you had clicked on R script instead, a window for entering code in R, similar to the one shown in Figure 1.4, would have appeared:

Figure 1.4 – Window showing the R script editor

Figure 1.4: Window showing the R script editor

As with Python, in order to run code in R, you need to install the R engine on your machine. Clicking on the How to install R link will open a Docs page where Microsoft suggests installing either Microsoft R Open or the classic CRAN R. Chapter 2, Configuring R with Power BI, will show you which engine to choose and how to configure your favorite IDE to write code in R.

In order to import data using Python or R, you need to write code in the editors shown in Figure 1.3 and Figure 1.4, which assign a pandas DataFrame or an R data frame to a variable, respectively. You will see concrete examples throughout this book.

Next, let’s look at transforming data.

Data transformation

It is possible to apply a transformation to data already imported or being imported, using scripts in R or Python. Should you want to test this on the fly, you can import the following CSV file directly from the web: http://bit.ly/iriscsv. Follow these steps:

  1. Simply click on Get data and then Web to import data directly from a web page:
Graphical user interface, application  Description automatically generated

Figure 1.5: Select the Web connector to import data from a web page

  1. You can now enter the previously mentioned URL in the window that pops up:
Figure 1.6 – Import the Iris data from the web

Figure 1.6: Import the Iris data from the web

  1. Right after clicking OK, a window will pop up with a preview of the data to be imported.

    In this case, instead of importing the data as is, click on Transform Data in order to access the Power Query data transformation window:

    Table  Description automatically generated

    Figure 1.7: Imported data preview

    It is at this point that you can add a transformation step using a Python or R script by selecting the Transform tab in Power Query Editor:

    Graphical user interface, table, Excel  Description automatically generated

    Figure 1.8: R and Python script tools in Power Query Editor

    By clicking on Run Python script, you’ll cause a window, similar to the one you’ve already seen in the data import phase, to pop up:

    Graphical user interface, text, application, email  Description automatically generated

    Figure 1.9: The Run Python script editor

    If you carefully read the comment in the text box, you will see that the dataset variable is already initialized and contains the data present at that moment in Power Query Editor, including any transformations already applied. At this point, you can insert your Python code in the text box to transform the data into the desired form.

    A similar window will open if you click on Run R script:

    Graphical user interface, text, application, email  Description automatically generated

    Figure 1.10: The Run R script editor

Also, in this case, the dataset variable is already initialized and contains the data present at that moment in Power Query Editor. You can then add your own R code and reference the dataset variable to transform your data in the most appropriate way.

Next, let’s look at visualizing data.

Data visualization

Finally, your own Python or R scripts can be added to Power BI to create new visualizations, in addition to those already present in the tool out of the box:

  1. Assuming we resume the data import activity started in the previous section, once the Iris dataset is loaded, simply click Cancel in the Run R script window, and then click Close & Apply in the Home tab of Power Query Editor:
Figure 1.11 – Click Close & Apply to import the Iris data

Figure 1.11: Click Close & Apply to import the Iris data

  1. After the data import is complete, you can select either the R visual or Python visual option in the Visualizations pane of Power BI:
    Diagram  Description automatically generated

    Figure 1.12: The R and Python script visuals

    If you click on Python visual, a window pops up asking for permission to enable script code execution, as there may be security or privacy risks:

    Figure 1.13 – Enable the script code execution

    Figure 1.13: Enable the script code execution

  1. After enabling code execution, in Power BI Desktop, you can see a placeholder for the Python visual image on the report canvas and a Python script editor pane at the bottom:
Graphical user interface, application  Description automatically generated

Figure 1.14: The Python visual layout

Once you drag the fields you want to use in your Python script into the Values area, you can write your own custom code into the Python script editor and run it to generate a Python visualization.

A pretty much identical layout occurs when you select R visual.

Using R and Python to interact with your data

In the previous section, you saw all the ways you can interact with your data in Power BI via R or Python scripts. Beyond knowing how and where to inject your code into Power BI, it is very important to know how your code will interact with that data. It’s here that we see a big difference between the effect of scripts injected via Power Query Editor and scripts used in visuals:

  • Scripts via Power Query Editor: This type of script will transform the data and persist transformations in the model. This means that it will always be possible to retrieve the transformed data from any object within Power BI. Also, once the scripts have been executed and have taken effect, they will not be re-executed unless the data is refreshed. Therefore, it is recommended to inject code in R or Python via Power Query Editor when you intend to use the resulting insights in other visuals, or in the data model.
  • Scripts in visuals: The scripts used within the R and Python script visuals extract particular insights from the data and only make them evident to the user through visualization. Like all the other visuals on a report page, the R and Python script visuals are also interconnected with the other visuals. This means that the script visuals are subject to cross-filtering and therefore, they are refreshed every time you interact with other visuals in the report. That said, it is not possible to persist the results obtained from the script visuals in the data model.

TIP

Thanks to the interactive nature of R and Python script visuals due to cross-filtering, it is possible to inject code that is useful for extracting real-time insights from data. The important thing to keep in mind is that, as previously stated, it is then only possible to visualize such information, or at the most, to write it to external repositories (as you will see in Chapter 8, Logging Data from Power BI to External Sources). Also, although it is possible to access resources on the internet from a visual script when developing in Power BI Desktop, it is no longer possible to do so when the report is published to the Power BIs Service (you will see what this is about in the next section) due to security issues. This restriction doesn’t exist for scripts used in Power Query.

In the final section of this chapter, let’s look at the limitations of using R and Python when it comes to various Power BI products.

Python and R compatibility across Power BI products

The first question once you are clear on where to inject R and Python scripts in Power BI could be: “Is the use of R and Python code allowed in all Power BI products?” In order to cover that, let’s briefly recap the various Power BI products and their usage in general. Here is a concise list:

  • Power BI service: This is sometimes called Power BI Online, and it’s the Software as a Service (SaaS) version of Power BI. It was created to facilitate the sharing of visual analysis between users through dashboards and reports.
  • Power BI Report Server: This is the on-premises version of Power BI and it extends the capabilities of SQL Server Reporting Services, enabling the sharing of reports created in Power BI Desktop (for Report Server) and Power BI Report Builder for Power BI paginated reports.
  • Power BI embedded: A Microsoft Azure service that allows dashboards and reports to be embedded in an application for users who do not have a Power BI account.
  • Power BI Desktop: A free desktop application for Windows that allows you to use almost all of the features that Power BI offers. It is not the right tool for sharing results between users, but it allows you to share them on the Power BI service and Power BI Report Server. The desktop versions that allow publishing on the two mentioned services are distinct and support slightly different sets of features. They are named Power BI Desktop and Power BI Desktop for Power BI Report Server, respectively.
  • Power BI mobile: A mobile application, available on Windows, Android, and iOS, that allows secure access to the Power BI service and Power BI Report Server, and that allows you to browse and share dashboards and reports, but not edit them.
  • Power BI Report Builder: A free desktop application for Windows that allows you to create paginated reports. These can then be published and shared in the Power BI service and Power BI Report Server.

Apart from the licenses, which we will not go into here, a summary figure of the relationships between the previously mentioned products follows:

Diagram  Description automatically generated

Figure 1.15: Interactions between Power BI products

Unfortunately, of all these products, only the Power BI service, Power BI Embedded, and Power BI Desktop allow you to enrich data via code in R and Python:

Diagram  Description automatically generated with low confidence

Figure 1.16: Power BI products, compatibility with R and Python

IMPORTANT NOTE

From here on out, when we talk about the Power BI service in terms of compatibility with analytical languages, what we say will also apply to Power BI embedded.

So, if you need to develop reports using advanced analytics through R and Python, make sure the target platform supports them.

Summary

This chapter has given a detailed overview of all the ways in which you can use R and Python scripts in Power BI Desktop. During the data ingestion and data transformation phases, Power Query Editor allows you to add steps containing R or Python code. You can also make use of these analytical languages during the data visualization phase thanks to the R and Python script visuals provided by Power BI Desktop.

It is also very important to know how the R and Python code will interact with the data already loaded or being loaded in Power BI. If you use Power Query Editor, both when loading and transforming data, the result of script processing will be persisted in the data model. Also, if you want to run the same scripts again, you have to refresh the data. On the other hand, if you use the R and Python script visuals, the code results can only be displayed and are not persisted in the data model. In this case, script execution occurs whenever cross-filtering is triggered via the other visuals in the report.

Unfortunately, at the time of writing, you cannot run R and Python scripts in every Power BI product. The only ones that provide for running analytics scripts are Power BI Desktop and the Power BI service.

In the next chapter, we will see how best to configure the R engine and RStudio to integrate with Power BI Desktop.

Test your knowledge

  1. At what stages of Power BI report development can scripts in Python or R be used?
  2. Is it possible to use a Python dictionary as a data source for a Power BI report?
  3. Is it possible to use an R list as a data source for a Power BI report?
  4. When you insert a Python or R script step immediately after other transformation steps that return a specific result set, what is the name of the variable you will need to use in your script to access the data obtained in the step just before?
  5. After adding a Python or R visual script to your canvas, what do you need to do to enable the script editor to take a script that generates a plot?
  6. What are the ways by which to force the re-execution of Python or R scripts added via Power Query?
  7. What are the ways by which to force the re-execution of Python or R scripts added in a script visual?
  8. In what case is it not possible to access the internet from a Python or R script in Power BI?
  9. In which Power BI products can Python or R scripts be used?

Learn more on Discord

To join the Discord community for this book – where you can share feedback, ask questions to the author, and learn about new releases – follow the QR code below:

https://discord.gg/MKww5g45EB

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Discover best practices for using Python and R in Power BI by implementing non-trivial code
  • Enrich your Power BI dashboards using external APIs and machine learning models
  • Create any visualization, as complex as you want, using Python and R scripts

Description

The latest edition of this book delves deep into advanced analytics, focusing on enhancing Python and R proficiency within Power BI. New chapters cover optimizing Python and R settings, utilizing Intel's Math Kernel Library (MKL) for performance boosts, and addressing integration challenges. Techniques for managing large datasets beyond available RAM, employing the Parquet data format, and advanced fuzzy matching algorithms are explored. Additionally, it discusses leveraging SQL Server Language Extensions to overcome traditional Python and R limitations in Power BI. It also helps in crafting sophisticated visualizations using the Grammar of Graphics in both R and Python. This Power BI book will help you master data validation with regular expressions, import data from diverse sources, and apply advanced algorithms for transformation. You'll learn how to safeguard personal data in Power BI with techniques like pseudonymization, anonymization, and data masking. You'll also get to grips with the key statistical features of datasets by plotting multiple visual graphs in the process of building a machine learning model. The book will guide you on utilizing external APIs for enrichment, enhancing I/O performance, and leveraging Python and R for analysis. You'll reinforce your learning with questions at the end of each chapter.

Who is this book for?

This book is for business analysts, business intelligence professionals, and data scientists who already use Microsoft Power BI and want to add more value to their analysis using Python and R. Working knowledge of Power BI is required to make the most of this book. Basic knowledge of Python and R will also be helpful.

What you will learn

  • Configure optimal integration of Python and R with Power BI
  • Perform complex data manipulations not possible by default in Power BI
  • Boost Power BI logging and loading large datasets
  • Extract insights from your data using algorithms like linear optimization
  • Calculate string distances and learn how to use them for probabilistic fuzzy matching
  • Handle outliers and missing values for multivariate and time-series data
  • Apply Exploratory Data Analysis in Power BI with R
  • Learn to use Grammar of Graphics in Python
Estimated delivery fee Deliver to South Korea

Standard delivery 10 - 13 business days

$12.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 29, 2024
Length: 814 pages
Edition : 2nd
Language : English
ISBN-13 : 9781837639533
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to South Korea

Standard delivery 10 - 13 business days

$12.95

Premium delivery 5 - 8 business days

$45.95
(Includes tracking information)

Product Details

Publication date : Mar 29, 2024
Length: 814 pages
Edition : 2nd
Language : English
ISBN-13 : 9781837639533
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 159.97
Extending Power BI with Python and R
$54.99
The Definitive Guide to Power Query (M)
$54.99
Mastering Microsoft Power BI – Second Edition
$49.99
Total $ 159.97 Stars icon

Table of Contents

24 Chapters
Where and How to Use R and Python Scripts in Power BI Chevron down icon Chevron up icon
Configuring R with Power BI Chevron down icon Chevron up icon
Configuring Python with Power BI Chevron down icon Chevron up icon
Solving Common Issues When Using Python and R in Power BI Chevron down icon Chevron up icon
Importing Unhandled Data Objects Chevron down icon Chevron up icon
Using Regular Expressions in Power BI Chevron down icon Chevron up icon
Anonymizing and Pseudonymizing Your Data in Power BI Chevron down icon Chevron up icon
Logging Data from Power BI to External Sources Chevron down icon Chevron up icon
Loading Large Datasets Beyond the Available RAM in Power BI Chevron down icon Chevron up icon
Boosting Data Loading Speed in Power BI with Parquet Format Chevron down icon Chevron up icon
Calling External APIs to Enrich Your Data Chevron down icon Chevron up icon
Calculating Columns Using Complex Algorithms: Distances Chevron down icon Chevron up icon
Calculating Columns Using Complex Algorithms: Fuzzy Matching Chevron down icon Chevron up icon
Calculating Columns Using Complex Algorithms: Optimization Problems Chevron down icon Chevron up icon
Adding Statistical Insights: Associations Chevron down icon Chevron up icon
Adding Statistical Insights: Outliers and Missing Values Chevron down icon Chevron up icon
Using Machine Learning without Premium or Embedded Capacity Chevron down icon Chevron up icon
Using SQL Server External Languages for Advanced Analytics and ML Integration in Power BI Chevron down icon Chevron up icon
Exploratory Data Analysis Chevron down icon Chevron up icon
Using the Grammar of Graphics in Python with plotnine Chevron down icon Chevron up icon
Advanced Visualizations Chevron down icon Chevron up icon
Interactive R Custom Visuals Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(30 Ratings)
5 star 96.7%
4 star 3.3%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Joseph C. Seroski Apr 01, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a good reference to understand how you can use Python and R in Power BI. It has a good introduction to getting setup and some great examples as to how you can extend your reports and advance your skills using these two programming languages.I enjoyed this book brings a unique perspective that I haven't seen in many other Power BI books. I am looking forward to getting more into the Python language, and this book will be helpful, especially with all the functionality coming to Fabric. I recommend this book to add another feather to your cap.
Amazon Verified review Amazon
Thomas Rice Aug 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
"Extending Power BI with Python and R" is a comprehensive and practical guide for enhancing data analysis capabilities in Power BI. With detailed explanations, practical examples, and step-by-step instructions, this book is an essential resource for anyone looking to integrate R and Python into their Power BI workflows. Whether you're a beginner or an experienced user, this book provides valuable insights and practical tips for maximizing the potential of Power BI. As an avid book worm, having read more than 30 books on the Microsoft Power Platform, this one is a must for anyone that works with Power BI. Highly recommended guys!
Amazon Verified review Amazon
Arden Jul 26, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book author has a strong hold over the Powerbi community and even the technology I believe this book is beneficial for people who have had a strong command over the Power BI, R and Python space because of the diversity it brings throughout the chapters, the most important thing is the journey of different libraries and how it has affected the whole space and how the case studies have been shared throughout the book. Congratulations to the authors for binding in a book of such quality!
Amazon Verified review Amazon
Sruthi Panikar Apr 16, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent book for anyone interested in python and r at the same time loved the book its an amazing title!
Amazon Verified review Amazon
Brady Apr 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A great resource for Power BI users aiming to bolster their analytical prowess. The authors offer well-explained and hands-on examples, leading readers through the intricacies of seamlessly integrating Python and R with Power BI.I was particularly drawn to the Python side of this book. I've often found using Python visuals or features in Power BI to be cumbersome. My visuals would load slowly, prompting me to revert to default visuals in Power BI and stick to traditional M query data transformations.This book opened up some possibilities I'd never considered where in the past I'd given up trying to implement. Python has much more appealing visuals and data capabilities but I didn't know how to use it without seemingly bogging down my entire report. As a heavy Power BI user, I got a lot of new ideas to consider from this book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela