Web Scrapping Online Stock Prices

Investing in financial markets is one of my  interests. 

I’ve built this report to help me track the performance of my investment in stocks.
As you may suspect it is something that I particularly care and for that reason this report is a real world scenario!

Due to privacy matters I am only showing % weights and variations on the investments. However, the truth is that’s the most important outcome of the analysis. Just assume x dollars and do the mats to convert it to  dollar amount

Technically, I’ve used a few distinct approaches to collect and transform the data used on this report:

  1. Excel file located in OneDrive for manual input of my transactions;
  2. R Quantmod package  to scrap daily prices from Google Finance
  3. HTML direct query Yahoo Finance for the EUR/USD forex rate.
  4. Image URL method to display the companies logos (OneDrive repository);
  5. Parameter and Invoked Function to change the Proxy and automatically recalculate the figures;
  6. A bunch of measures with var … return if …, lookup table and others not so fancy but effective technics
  7. and more.

This still work-in-progress project, so not be surprise if it had changed meanwhile.
If you are interested to know mora about this report and/or the technics I’ve used here,  just drop me an email or leave a comment below.

Power BI April 2020 release

It’s power week and Power BI team has released a bunch of super cool Power BI updates!!! Some of them highly requested by the Power BI community. Excited to learn all about them?

Check out our Top 5 features you need to know about:

#5: Rectangular lasso select across visuals

You can now select your visuals and other report elements by clicking and dragging over the canvas to create a rectangular lasso. All visuals that are entirely encapsulated within the lasso will be selected. If you are holding down Ctrl + G you can also group visuals.

#4: Customized themes

The new theme dialog is now generally available. You can customize a theme in the theme dialog, with you company colour, font etc, an icon will represent that custom theme in a separate section and will update whenever you customize your theme.

 If you hover over the icon, a tooltip will show up that explains that the theme is a custom theme, and the theme name will also show up if you define it. 

#3: Improved discoverability for conditional formatting & Conditional formatting for totals and subtotals in table and matrix

These are actually 2 separate updates but they definitely deserve to be mentioned, the menu to access the conditional formatting was very difficult to find previously but with his release Microsoft team have updated the entry point into the conditional formatting dialog to make it more discoverable, but displaying an fx button to the right of the object you would like to format.

Clicking the fx button will bring up the conditional formatting dialog. After applying a conditional formatting rule, the input field should now look like this:

Conditional formatting for totals and subtotals in table and matrix

This is probably one of the most requested features by the community, now it will be possible to apply conditional formatting rules to totals and subtotals in table and matrix visuals.

 

#2:Change detection for page refresh

This is a new option for an automatic page refresh, in which the page is refreshed based on change detection instead of a specific refresh interval. This is a query that will run in the background to check if data has changed and will only refresh the report if a change has been detected. In this release, we will have a new data change detection option to specify how to query for changes to our Direct query source, specifically which measure should be evaluated and how frequently they should be checked for changes to that measure.

Important considerations for this new capability:

  • Only DirectQuery sources are supported
  • You’re only allowed to specify one change detection measure per model
  • In Desktop, when you set up change detection, visuals won’t refresh. You will have to publish to the service for page refresh to work, which includes re-authenticating with the same credentials for refresh.
  • This is a premium only feature
  • Premium capacity admin must turn this on in the admin portal

#1:Personalize visuals

This is a new visual personalization feature to allow your end-users to explore and personalize visuals all within the consumption view of a report. This is definitely our favorite new feature as it gives the end-users the ability to explore and modify the properties of a visual by having the full editing experience.

Using this feature, your end-users can explore a visual in many ways:

  • Change the visualization type
  • Swap out a measure or dimension
  • Add or remove a legend
  • Compare two or more different measures
  • Change aggregations, etc.

Not only does this feature allow for new exploration capabilities, but it also includes ways for end-users to capture, share, and revert their changes:

  • Capture their changes
  • Share their changes
  • Reset all their changes to a report
  • Reset all their changes to a visual
  • Clear out their recent changes

Please let us know which was your favorite release and if you agree with our top 5.

To know more about the power BI April 2020 update visit:

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-april-2020-feature-summary/#_Personalize_visuals

Emails Tracker with Power Automate and Power BI

Many times we need to keep tracking emails related with a particular subject, received from a specific address or sent to a defined mailbox, etc. From day-to-day operations to external contacts, there are plenty of real life scenarios when it happens and there is a big probability be doing it currently.
The majority of the time our options are either, go email by email and copy the entries into a spreadsheet or pay for one of the thousand software off-the-shelf available in the market nowadays. If the latter can be expensive, the former is not only time-consuming but also it can lead to many errors.

The good news are there is a third option that is a really cheap and easy way to automate and improve this process. We are going to use Power Automate, Outlook, SharePoint and Power BI from your Office 365 subscription.

Flow diagram

In this scenario we are tracking emails received in a Shared Mailbox with a particular Subject. In order to automate the process we are going to create a flow in Microsoft Flow that is recording and entry for each email received in a SharePoint List. Then we connect Power BI to the SharePoint List and import the data to create a Report that is going to be our Email Tracker. After published to the Power BI Service we are going to embed the report into a SharePoint Page. Parallel to it, an email with dashboard is sent daily to the subscribers. Continue reading “Emails Tracker with Power Automate and Power BI”

Intro to Measures and Slicers

Check out Video #5 of Power BI Series and learn about DAX Measures and Slicers in Power BI Desktop.

This video covers:

  • How to create a Measure
  • Intro to Quick Measures and standard calculations
  • Intro to Slicers and Edit Interactions

If you are starting learning DAX I suggest:

  • Book:  Power Pivot and Power BI by Rob Collin & Avi Singh.  This was one of the first books I read about DAX.
  • Blog:  DAX Fridays  by Curbal.com . Ruth releases a video every Friday covering DAX functions (and more) and to date, the playlist counts with more than 80 videos.  Awesome work .

There are plenty of other sources (books, blogs, videos, etc), but these are my recommendations if you are new to DAX and Power BI and want to learn the basics.

DAX and M edition Helpers

We need to admit, the GUI for Power BI Formula Bar (DAX) and the Power Query Advanced Editor (M) are not the most user-friendly.
DAX editor (formula bar) is getting better but still quite limited. M editor (Advanced Editor) … OK, this might be something more advanced and eventually not everyone will need to write M functions.

But just in case if you are interested on it, these are my Helpers to write and format DAX and M code:

    • DAX STUDIO – “DAX Studio is a tool to write, execute, and analyze DAX queries in Power BI Designer, Power Pivot for Excel, and Analysis Services Tabular.” by SQLBI
    • DAX FORMATTER -“DAX Formatter is a free tool that transform your raw DAX formulas into clean, beautiful and readable code.” by SQLBI
    • POWER BI HELPER – “Export the Entire M Power Query Script from a Power BI File” by RADCAD
    • NOTEPAD++ – “Notepad++ is a text editor and source code editor for use with Microsoft Windows.” by Don Ho

Continue reading “DAX and M edition Helpers”

Calculated Columns in Power BI Desktop

Check out Video #4 of Power BI Series and learn two easy ways how to create a calculated column in Power BI Desktop.

This video covers:

  • Create a Calculated Column in DAX
  • Create a Calculated Column in Power Query
  • Delete Calculated Columns differences and Errors

You can download the files here:
Link to GitHub

And access the online dashboard here

Dublin Data & BI Summit

From the 24th to the 26th of April I am going to attend the Data & BI Summit in Dublin.

This is the Microsoft Power BI big event of the year. During three days Power BI authorities, gurus, wizards and evangelists will gathering under the same place. The result can’t be no other than awesomeness!

If you are around drop me a message and let’s have a coffee.

 

Load Multiple files and Append Query

In the 3rd video of the Power BI Series I show you how to load multiple files into Power BI using the Query Editor and to troubleshooting a Date type Error.

In this video we covered:

– How to load multiple excel files to Power BI
– How to use  Append Query to create a unique dataset
– Date error- Use locale
– Regional Settings

Keep tuned for the next video and learn How to Create Measures and Calculated Columns 

You can download the files here:

  1. Link to  GitHub
  2. Link to  OneDrive

And access the online dashboard here

Power BI Series – Refresh Data

In the 2nd Video of the Power BI Series I show you how to refresh the model with new data.

In this video we are covering:

    • Refresh the model with new data
    • Introduction to Power Query
    • Common Errors and how to troubleshoot it
    • Best Practice for file naming

Keep tuned for the next video and learn How to append multiple files using  the Power Query editor

You can download the files here:

  1. Link to GitHub: https://github.com/Bordalos/Power-BI/
  2. Link to OneDrive: https://1drv.ms/u/s!At1CSmc…

And access the online dashboard here