Friday, April 26, 2019

Power BI DAX #2: Meet the most popular DAX formula -- CALCULATE

Anyone wanting to do any serious data analysis with Power BI must be very good friends with CALCULATE.  Most books and online resources will tell you that CALCULATE gives you power over the filter context, enabling you to modify it as you wish. Example of one such online resource is Microsoft Documentation: https://docs.microsoft.com/en-us/dax/calculate-function-dax 

I, however, have an easier to digest way of explaining it to people entirely new to Power BI and don't know what context means.

I assume you are already very familiar with Microsoft Excel. 

In Microsoft Excel, when you need to do a formula, you simply go into one cell and type out formulas that typically give you back one result which will show in that cell.



That is the usual usage pattern. However, there is another way of inputting formulas in Excel. If you convert the Excel data into table (Format as Table), any formula you type in the table works across the table entire rows. You don't have to drag down the formula.



How does all these relate to Power BI?

Well, the more intuitive way of entering formulas in Power BI is the second way I mentioned. Any formula you enter gets computed for the entire rows in the table. It's called New Column.



But what if you want to calculate the total sales for Enugu branch, like I did in the first Excel screenshot? Well, one has to do a New Measure, as that is what gives you one value rather than values as many as the number of rows in our table. In Excel, this would be easily solved with a SUMIF.

In Power BI, there is no SUMIF nor COUNTIF nor AVERAGEIF nor SUBTOTAL. Rather what you have is this amazing formula called CALCULATE. It makes it possible to extract out the rows/records that meet conditions you specify and then you run any normal aggregation/expression on the extract (like SUM, AVERAGE etc). So it is your SUMIF, COUNTIF, AVERAGEIF and many more common formulas you use in Excel. In fact, it is more than all of them. It does near magical things.

So how does CALCULATE work?

You specify the aggregation/expression you want and then put in filter conditions to narrow down to just the very records you want to run that expression on. 

In this very example I have shown via screenshots, here is the CALCULATE formula I entered:

Enugu Sales = CALCULATE(SUM('Pizza Sales Data'[Amount Sold]),'Pizza Sales Data'[Branch]="Enugu")



And that's how CALCULATE works.

However, don't be deceived by the simple straightforward example I have used. As you progress in your Power BI journey you will definitely have to get comfortable mixing CALCULATE with FILTER, ALL, ALLEXCEPT and many other DAX formulas. That's where the true mastery and magic lie. Also, you should read up on row context and filter context in Power BI.


You can watch the YouTube tutorial: https://youtu.be/Vzro-tgDr_8



Enjoy!

And to join our training class, visit https://www.urbizedge.com/powerbi

Sunday, April 21, 2019

Power BI DAX #1: The Magic of CROSSJOIN


Last week I facilitated a training where the participants were staff of Nigeria Bottling Company (makers of Coca-Cola in Nigeria). After my usual prepared practice, we delved into making the types of reports they need. 

One of the reports had a very interesting twist that CROSSJOIN was perfect for. For confidentiality, I won't tell you the exact situation we had regarding the said report but I have created a simpler and easier to relate with example that I will use to show you the magic of CROSSJOIN.

CROSSJOIN is a DAX formula that generates the cartesian product of all the rows in tables inputted into the formula argument. You can go through Microsoft's official documentation on it at https://docs.microsoft.com/en-us/dax/crossjoin-function-dax 

CASE STUDY
ABC Limited has five branches across Nigeria and sells four products. Each product has same target across all the branches.


Branch
Manager
Lagos
Jide Aje
Abuja
Ahmed Kazeem
Kaduna
Sanni Eze
Port Harcourt
Joe Opoi
Enugu
Chika Nwabueze

Product
Target
Product A
100
Product B
120
Product C
90
Product D
130

You are to generate a new table that will combine these two tables into one -- having all four products with assigned targets showing for all the five branches.

Branch
Manager
Product
Target
Lagos
Jide Aje
Product C
90
Abuja
Ahmed Kazeem
Product C
90
Kaduna
Sanni Eze
Product C
90
Port Harcourt
Joe Opoi
Product C
90
Enugu
Chika Nwabueze
Product C
90
Lagos
Jide Aje
Product A
100
Abuja
Ahmed Kazeem
Product A
100
Kaduna
Sanni Eze
Product A
100
Port Harcourt
Joe Opoi
Product A
100
Enugu
Chika Nwabueze
Product A
100
Lagos
Jide Aje
Product B
120
Abuja
Ahmed Kazeem
Product B
120
Kaduna
Sanni Eze
Product B
120
Port Harcourt
Joe Opoi
Product B
120
Enugu
Chika Nwabueze
Product B
120
Lagos
Jide Aje
Product D
130
Abuja
Ahmed Kazeem
Product D
130
Kaduna
Sanni Eze
Product D
130
Port Harcourt
Joe Opoi
Product D
130
Enugu
Chika Nwabueze
Product D
130

So how do we achieve this?

ANSWER: CROSSJOIN

If you want to follow along and recreate this tutorial, just launch Power BI. And under Home menu, click on Enter Data. Copy paste or type in the Branch table data.


Repeat same steps for Product table.



And to the magic step: under Modeling menu, click on New Table and type CrossJoin Table = CROSSJOIN('Branch Table','Product Table')


And voila! You are done.

BONUS: What if you needed to do this in Excel?
You will have to use PowerQuery's Unpivot, and maybe more than once if both tables have more than 2 columns of relevant data.

You can watch the YouTube tutorial: https://youtu.be/A_2GM4Ig24k 



Enjoy!

And to join our training class, visit https://www.urbizedge.com/powerbi

Monday, November 19, 2018

How To Scrape Data From A Website Into Power BI (AbokiFX as an example)

Power BI is an amazing tool. I have used it to create amazing auto-updating dashboards for different reporting needs. You can view a couple that I made publicly available: https://www.nigerianelite.com/Shares/Analysishttps://community.powerbi.com/t5/Data-Stories-Gallery/Sales-Dashboard-for-a-Pizza-Restaurant/m-p/509025#M2208 and https://community.powerbi.com/t5/Data-Stories-Gallery/Nigerian-Stocks-Market-Analysis-Live-Report/m-p/175769#M850

Today, however, I will be showing you how to use Power BI to scrape data from a website and create a report/dashboard from the scrapped data. I will illustrate with AbokiFX.com data on parallel market FX rates for Nigeria. Effectively, you will be creating a report like the one below:




STEP 1
From an empty Power BI desktop file, do Get Data and pick from Web (under Other).


Follow through with providing the URL of the website to pick data from and selecting the table of data to pull into Power BI.



STEP 2
Do a couple of transformation on the data (except you are very lucky that the pulled data is already in a form that suits your report).



STEP 3
Create the report you want and publish.



You may also want to configure a scheduled refresh to make Power BI keep pulling new data from the website everyday.

Saturday, August 25, 2018

Comprehensive Financial Modelling and Financial Planning Training



Register for the upcoming hands-on Nigerian industry relevant Financial Modelling.

Just 10 slots available!

Our lead trainer has built financial models, investment portfolio risk models, stocks analysis models, automated financial reporting templates, loan schedules, FX tracker, market indices tracker and many other financial projects for corporate clients within and outside Nigeria. He is not going to share book knowledge with you but real world expertise and templates you can readily use. He is also one of the few Africans that have been vetted and accepted as a Financial Modelling and Valuation expert on TopTal whose client base span fortune 500 companies and other big companies across Europe, Americas, Australia and Asia. You can view his TopTal profile here

He is the sole developer of the only Nigerian financial markets analysis tool on Microsoft office store, developer of Nigerian stocks analysis dashboard and the brain behind the Nigeria Market Data platform.

He has also published an Amazon bestseller on Microsoft Excel: Microsoft Excel and Business Data Analysis for The Busy Professional and another bestseller on Power BI Power BI for the Busy Professional book. He is the type of all-rounder you would want to be trained by. 

This training is aimed at making you proficient in building Financial Models and carrying out Valuation for existing businesses, startups and capital projects. You will learn to create financial models from scratch using Microsoft Excel and build one during the training on a real Nigerian company. You will also learn how to apply them in real world situations so as to help friends with their business valuations, help your company with financial planning and advise clients on equity funding. The training is strictly targeting people with accounting background and basic knowledge of corporate finance.

You will get lunch, a branded DVD with training materials and templates, training notepad with pen, hardcopy comprehensive training reference materials, a training certificate from us (a registered Microsoft Partner), access to our online community and after training support.

Our different trainings have had participants from Guinness Nigeria, Nigerian Breweries, Schlumberger, Chevron, Periscope, Brains and Hammers, GfK, Palladium Group, First Bank, Citi Bank, Dalberg, PMI, EatNGO, NLNG, GSK, Promasidor, SaveTheChildren, Mobil, FMDQ, NSE, Biofem Pharmaceuticals, Total, Vodacom, Nestle, Nigerian Breweries, Delta Afrik, LATC Marine, Broll, Habanera (JTI), SABMiller, IBM, Airtel, Diamond Bank, ECOWAS, Ministry of Finance, Transmission Company of Nigeria, Nokia Siemens Networks and DDB.

Reach Michael on 0700ANALYTICS, 0808-938-2423, 0806-312-5227 and mike@urbizedge.com or Hannah on 0802-118-0874 and hannah@urbizedge.com or Emmanuel on 0908-482-5064 and emmanuel@urbizedge.com to register.

Date: Monday 17th September 2018 to Wednesday 19th September 2018.
Venue: Kristina Jade Learning Center, 70b Olorunlogbon street, Off Alade Lawal street, Anthony Village, Lagos.

For Kenya, Ghana, Cameroon, Togo and Benin: Kindly contact us on +1-941-312-2149 or email info@urbizedge.com for details of training date. Thanks!

The training outline is:

1) Introduction to Financial Modelling and Valuation
a. Referesher on the fundamental accounting principles
b. Building a Trial Balance
c. Building the Income Statement from the Trial Balance
d. Building the Balance Sheet Statement from the Trial Balance
e. Building the Cash Flow Statement from the Trial Balance
f. Introduction to Financial Ratios

2) Different Types of Financial Models
a. Discounted Cash Flow (DCF) Model
b. Comparative Company Analysis (comps) Model
c. Sum-of-the-parts Model
d. Leveraged Buy Out (LBO) Model
e. Merger and Acquisition (M&A) Model
f. Book value Model
g. Dividend Discount Model

3) Building a Discounted Cash Flow Model from Scratch
a. Template Building from Scratch
i. Creating the Required Sheets and Having an Index Sheet
ii. General Model Structure Design
iii. Working Across Multiple Sheets at Once
iv. Linking Sheets
v. Absolute and Relative References
vi. Template Building Tricks
b. Required Excel Tools and Formulas
i. What-If-Analysis Tools: Goal Seek, Scenario Manager and Data Table
ii. Charts
iii. PivotTable and PowerPivot
iv. Power Excel Formulas

4) DCF Modelling Stages
a. DCF Modelling Stage One: Projection Ratios and Scenarios (Optimistic, Base and Pessimistic)
i. Income Statement Drivers Projections
ii. Balance Sheet Drivers Projections
b. DCF Modelling Stage Two: Financial Statements Forecasts
i. Income Statement Forecast
ii. Balance Sheet Forecast
iii. Cashflow Statement Forecast
c. DCF Modelling Stage Three: Valuation
i. Enterprise Value = Discounted Cashflow of Explicit Forecast Period + Discounted Terminal Value
ii. Calculation of WACC, CAPM and Cost of Debt
iii. Practical Reality of the Nigerian Economic Space
iv. Extracting The Equity Value from The Enterprise Value
v. Senitivity Analysis: WACC vs Perpetuity growth
d. Practical Use of The Results
i. Company Valaution: Sell-side, Buy-side and Advisory
ii. Business Unit or Subsidiary Valuation
iii. Capital Project Valuation

5) Financial Ratios
a. Liquidity Ratios
b. Asset Management Ratios
c. Leverage Ratios
d. Profitability Ratios
e. Valuation Ratios
f. Financial Project Planning Excel formulas


Reach Michael on 0700ANALYTICS, 0808-938-2423, 0806-312-5227 and mike@urbizedge.com or Hannah on 0802-118-0874 and hannah@urbizedge.com or Emmanuel on 0908-482-5064 and emmanuel@urbizedge.com to register.

Monday, August 20, 2018

Industry First (from UrBizEdge): Data Analysis As A Service. You’ll Love It!


We recently came up with this innovative solution for busy professionals. It is an industry first: DaaS. Data Analysis As A Service. A subscription based service. In fact, I'll share with you the very announcement letter/email I sent out to our customers/leads.

Make us your secret weapon!

Have you ever experienced the analyst's block (kinda like writer's block, when you just don't know how to make the report you want)?

Have you ever felt your report could be better?

Have you ever felt like you were not making the most of the data at your disposal? Like there is more you could be uncovering and tracking and reporting?

Have you ever felt you need experts you can call on any day and at any time but won't cost you an arm and leg?

Okay, maybe I lied about the not costing you an arm and leg. The good thing is that we have structured it flexibly so you can always get more value than the cost.

We have created an industry first: DaaS (Data Analysis as a Service).

Maybe you have tried training. Perhaps you have attended our in-depth high value training class. You have our video learning materials, our book and our practice files. We hope you remember everything we taught you. However, things are changing. You are changing. Your work is changing. The industry is changing. Excel is changing. Power BI is changing. Everything is changing. You already have a demanding job and can't be spending all day keeping abreast of what's new and applicable to you as regards making the most of your data and reports. We are offering to be your secret weapon.

So what's the DaaS structured as?

It is simple and straightforward as ABC.

A. You can reach us remotely (calls, Skype, emails, SMS etc) and at our office (70b Olorunlogbon street, after Banex hotel, Anthony Village, Lagos) for targeted help with your office work. Note: we won't come to your office or house.
B. There is fair usage policy (FUP). So you have to book not less than 24hrs prior and you are entitled to 24hrs/month (which is equivalent to 3 full days) consulting time (both remote and physical). Any length of time above that will attract some extra small charge/fee.
C. You have a dedicated resource (more like technical account manager). It is not Michael. He/she is your primary contact, handles all your work requests, communication, meetings and projects. There is a pool of internal resources (Michael inclusive) he/she will draw on, as appropriate, to satisfy all your relevant needs. We have full-time data analysts that are already handling consulting projects and training, so just as skilled as Michael and they are the ones designated as technical account managers.

So how much does this cost?

That's the best part: there are four flexi plans.
  1. N45,000/month. You can cancel anytime and restart anytime (no refunds, when you cancel it means you just don't pay when your subscription elapses).
  2. N90,000/quarter
  3. N150,000/half-year
  4. N200,000/year
And it's not negotiable. Why that funny pricing structure? That is the result of our own in-house data analytics on the pricing.

We already bill N100,000/day for one-on-one consulting (corporate clients rate is N250,000/day) and even when we are overpowered by the superior negotiating tactics of some of you, we only go as low as N70,000/day for individuals. And that is 8 hrs at a go which is never as effective as two separate 4 hrs, and way less than the 24 hrs spreadable over an entire month that we are offering you at N45,000/month and even less than N19,000/month when you take the year option.

We can only service 10 people at the same time. So if you need our service but delay too much, you will have to wait for an open slot if all 10 slots are taken. And just as we can't review the price downwards, so also will we not accept you doubling the fee so we can take you up.

What do you think?

If interested, get in touch as soon as you can and we will get in touch with you. Reach Michael on 0700ANALYTICS, 0808-938-2423, 0806-312-5227 and mike@urbizedge.com or Hannah on 0802-118-0874 and hannah@urbizedge.com or Emmanuel on 0908-482-5064 and emmanuel@urbizedge.com

Again, welcome to the world of DaaS!


To your Excel-ling!
Michael Olafusi
0700ANALYTICS
www.urbizedge.com

P.S. We have now fully launched our open class Financial Modelling and Financial Planning course, you can read up on the details and registration steps at https://www.urbizedge.com/FinancialModelling We've spent three years perfecting the curriculum via doing on-request financial modelling training for companies, and building models for both foreign and local clients.

Tuesday, July 31, 2018

Join Us: Nigerian Excel Users 2018 Meetup on 1st September, 2018



Last year, we had a great time rubbing minds on the amazing things one could do with Microsoft Excel and had a presentation on other data analytics platforms. There were participants from all over Nigeria and the community has kept growing strong and sharing career growing knowledge.

This year, there will be a similar meetup/conference and you can RSVP at https://www.meetup.com/Nigerian-Excel-Users-Meetup/events/253308965/

Below is the agenda:

Nigerian Excel Users 2018 Meetup
The Zone Tech Park, Plot 9 Gbagada Industrial Scheme, UPS b/stop, Gbagada - Oshodi Expressway, Lagos.
1st September, 2018 (10:00am to 3:30pm)

Start Time: 10:00am

1) Introduction and networking (25 mins)

2) General Discussions pt 1(Your Excel Journey, career advantage, Excel pet peeves, ideas, the esoteric, 40 mins)

3) Presentation 1 (25 mins) + Q & A (10 mins)

4) Presentation 2 (25 mins) + Q & A (10 mins)

5) Break (10 mins)

6) Presentation 3 (25 mins) + Q & A (10 mins)

7) Presentation 4 (25 mins) Q & A (10 mins)

8) Break (10 mins)

9) Presentation 5 (25 mins) Q & A (10 mins)

10) Presentation 6 (25 mins) Q & A (10 mins)

11) General Discussions pt 2 (Your Excel Journey, career advantage, Excel pet peeves, ideas, the esoteric, 30 mins)

12) Close (5 mins)

End Time: 3:30pm (Networking continues)

There will be drinks and snacks.

Also, if you are interested in making a presentation, then you can fill the following Google form (link here)