Power BI – Create Custom Interactive Visuals with R

Power BI – Create Custom Interactive Visuals with R

Prerequisites Install node.js: Download and Install the latest version of node.js from  the node.js website Install R : Download and install the latest version of R from here.Once R is installed I also recommend you to install R Studio the integrated development environment for R.  Enable R scripting in Power BI: In Power BI desktop, go to File > Options and settings > Options>R Scripting: Then set up your R home directories and R IDEs. Set up Node js Open…

Read More Read More

DAX – TREATAS function – Book-to-Bill Ratio use case

DAX – TREATAS function – Book-to-Bill Ratio use case

Treatas is a powerful DAX function that applies the result of a table expression as filters to columns from an unrelated table. In other words, treatas applies the filter context of a specific table to another unrelated table (no relationship in the model). Book to Bill ratio A book-to-bill ratio is the ratio of orders received vs orders shipped and billed for a specific period, a month in our case. The book-to-bill ratio reveals how quickly a business fulfils the demand for…

Read More Read More

Power BI Exclude data based on Slicer selection

Power BI Exclude data based on Slicer selection

In Power BI the slicers allow us to filter and view only the information that we want but we can also in Power BI Exclude data based on Slicer selection. In this short post, I will show how we can reverse the behaviour of a slicer “excluding” the selected values instead of “filtering” the selected values. What is a Power BI Slicer? In Power BI a Slicer is a canvas visual that allows us user to filter and view only…

Read More Read More

Visual level filters for slicers

Visual level filters for slicers

Since the latest Power BI release (June 2019) we are now able to filter a slicer based on a measure!And I think we’ve all been waiting for this feature for quite a while. One of the top reason we needed this feature was to have the ability to sync slicers. (Well this was already achievable with the bidirectionnel filter which is a really bad practice…) So as we can see on the example below the customer Alma has bought only…

Read More Read More

Ho to set up Jupyter notebook default folder in Anaconda

Ho to set up Jupyter notebook default folder in Anaconda

I have two laptops with Anaconda installed on both and I had some issues to find a working solution to configure the start in folder of Jupyther so I though it’d be a good idea to post the two solutions that worked for me. Using PowerShell command Open the windows powershell prompt or the powershell Anaconda prompt and type the following: This will generate a file to your user default directory: C:\Users\username\.jupyter\jupyter_notebook_config.py Then open this file in any Editor and…

Read More Read More

Visualising Deviation From Average in Power BI

Visualising Deviation From Average in Power BI

In this post, I illustrate how to implement Deviation From Average in Power BI and why we should use it. Margin is a key metric to assess high-level performance of a company. But sometimes we want to measure and compare specific shop or department or employee performance with the entire company overall performance and this where deviation from average metric comes to help. The requirement are as follows: Company overall margin over time (which is just the margin average) Employee…

Read More Read More

DAX Time Intelligent – Single Measure For Multiple Dates

DAX Time Intelligent – Single Measure For Multiple Dates

Let’s assume a scenario where we have 50 time intelligent measures and 5 dimension Dates (order, invoice, ship, due, calendar…). If we want the 50 measure to interact with the 5 dimensions we would need to create 250 measures which might rapidly overwhelm the users as they must sift though so many measures. This script below allows you to drag any dates with the YTD margin measure and the measure will dynamically apply the calculation accordingly and thus keeps our…

Read More Read More

SSRS Multi-Value parameter in DAX

SSRS Multi-Value parameter in DAX

Setting up Multi-Value Parameter using DAX in 3 steps For those who are already familiar with SSRS using MDX it’ll be pretty straightforward as this is exactly the same logic, only the syntax changes… You can download the  AdventureWorks Tabular Database Sample here 1. Multi-Value Parameter We first need to create a parameter e.g “param_CountryRegionName” and then generate the country with he following DAX query: We can run the above code in the DAX designer to see the multiple values of…

Read More Read More

How to change the size of Plot Figure Matplotlib

How to change the size of Plot Figure Matplotlib

  When plotting figures with matplotlib you might want to change the size of the figure displayed. So here is a quick trick to adjust the size import matplotlib.pyplot as plt #Inside your plot code just type the following line of code #Set the plot width to 12 inches and height to 6 inches plt.rcParams[“figure.figsize”] = [12,6]  For more details see the  figure  documentation .

T-Test: Dr. Semmelweis and the discovery of handwashing

T-Test: Dr. Semmelweis and the discovery of handwashing

This article only illustrates the use of t-test in a real life problem but does not provide any technical information on what is T-Test or how T-Test works. I will go through the T-test in details in another post and will link it into this post. Intro I was looking for a cool dataset to illustrate the use of T.test and I found this DataCamp project “Dr. Semmelweis and the discovery of handwashing”. This a straightforward project but I really…

Read More Read More

Export Data from Power BI into a file using R

Export Data from Power BI into a file using R

We usually import Data from file into Power BI, but exporting data from Power BI can be very handy when you want to create a custom visual using R. In fact it can be very cumbersome to code your visual directly into the Power BI script editor. Here are few reasons why you should opt for exporting your Power Bi dataset first and re-import it in R to create your visual. Intellisense is not available in Power BI R script…

Read More Read More