Will Joel Be Lazy Today? A PowerApps AI Exploration

In February I got an Apple Watch to hold myself accountable for staying active. After AI Builder was announced at the Business Applications Summit, I decided to use the watch data to see what factors influenced my activity.

Gathering Data

There are a couple ways to get data out of the iPhone’s Health app. I found the appropriate table that tracks data for the Apple Watch Movement ring and threw it in Excel.

The next step was to dream up some factors that might influence my activity on a daily basis. These are intuitions and guesses based on my own personal experience. The factors I came up with were:

  • Climate (weather high and low)
  • Day of the week
  • Goal streak – consecutive days of being active
  • Total hours of meetings

This data gathering and theorizing was by far the most time intensive part of this process – more on that later. Below is the first summary table by day. One field contains the binary class field of whether I hit my daily movement goal.


Adding Data to PowerApps

Data needs to be stored in a CDS Entity for AI Builder to see it. Creating the Entity is fairly straight forward.

Surprisingly, importing data from an Excel file was a very frustrating processes. This seems a fairly basic requirement, especially for something like AI Builder where quickly iterating is key to success. Some of the issues I encountered include:

  • Cannot create the Entity fields based on the Excel file.
  • Had to create a new Excel file with only one tab.
  • Fields aren’t automatically mapped, even though the field names are identical.
  • Errors are common, and error handling information is complicated to view.
  • When the import is complete, or errors out, there’s no close or back button.
  • There’s no easy function to delete all the records when re-importing, which makes it hard when the data and fields keep evolving.

Once data is ready, building the AI model is dead simple. Next > Next > Finish type stuff.

Improving the AI Model

My initial models were kind of dumb. For example, I hadn’t designed my “Goal streak” data field correctly and it ended up predicting 100% of the time whether I hit my goal, because it was a circular reference.

I went back to Excel and started to investigate the data field by field via Pivot tables to see trends and improve the dataset. For example, below are the trends by day of the week against the binary classification.


I found each data point to not be individually super helpful, but there were some minor trends that matched my intuitions – which I would assume AI would take and go do magic AI things.

I also tried to classify the data into more broad groupings – I assumed an AI model might struggle to understand a variety of temperature integers, for example. I’m not a Data Scientist and I was making educated guesses based on my intuitions and some data trends I saw to come up with the classifications and help simplify the predictions.

My intuition, and individual data points, suggested the following:

  • I’m more likely to be active when it’s warmer.
  • I’m more likely to be active when I don’t have a lot of meetings.
  • I’m more likely to be active when I’ve been consistently active prior days.

The counter intuitive data I found was:

  • I’m lazier on the weekend (including Friday). Probably because I’m writing long blogs instead of going outside.

Testing the AI Model

Let’s take Joel’s Laziness for a test drive.

Here’s what the model shows.

Power AI

I used the Excel add-in to put in my data points from yesterday that weren’t included in the training dataset. The predicted result of hitting my Saturday goal:


Exactly right!!! We’re all living in the future!



I’m Gonna Need Some Detail Over Here

AI Builder is a preview version of a complicated subject, and I want to have realistic expectations. After all, the AI model did get it right.

The problem is – looking at raw data in Excel gave me actionable information, while AI Builder didn’t. Going forward, I need to know the reasons why the prediction is “Yes” or “No”, so I can change my behavior based on the prediction. Looking at the raw data in Excel informed me that I suck at exercise on the weekend.

It’s Sunday.

I’m going for a walk.



Salmon Fishing in the Dynamics

First of all – funny movie.

Second of all – WHAT ARE YOU “CW” FIELD?


You’ve run across it. Sitting there on your Purchase order and Vendor invoice forms. Using up your precious grid real estate. Making you tell your boss to buy you a giant monitor (I recommend this one) so you can comfortably fit Dynamics on your screen.

D365FO Vendor Invoice - License Configurations On

With a big enough monitor, any form will fit!

Does Anyone Even Need a CW?


Apparently when you go fishing for salmon, the “Catch Weight” (CW) used to inventory the salmon (Lbs or Kg) can be different than the weight used to sell the salmon (Boxes). There are special requirements for buying and selling meat that need additional weight based functionality.

Whatever – Make it Go Away

In F&O there’s a License configuration form available (System administration > Setup > License configuration). In this form you will find there are all kinds of functionalities that can be deactivated, including the famous Salmon Fishing configuration:


To turn off functionality, F&O needs to be in Maintenance Mode, then it’s a matter of unchecking the Boxes to be deactivated. Almost all License Configurations are on by default.

Going back the Vendor invoice form, it’s looking much more manageable with Configurations deactivated!

D365FO Vendor Invoice - License Configurations Off

Begone, Salmon!

Most License configurations are fairly obvious whether they’re in use just from the title, but sometimes it does take some trial and error in a Test environment to get this perfected. It’s much easier to configure this prior to a full User Acceptance Test to ensure no features are negatively impacted.

A Warning About Production Environments

In some versions of Dynamics AX (and possibly Dynamics 365 F&O), modifying the License Configuration did a Database Synchronization that could result in data loss. My testing has shown in later versions of Dynamics 365 F&O a Database Synchronization no longer happens. As of publication time, I did not receive a response from Microsoft on when the behavior changed.

My recommendation is to update the License Configuration settings prior to going live.


I will update this article if Microsoft comments on the safety of changing this in Production. In other words, if a feature was inadvertently deactivated, can it be reactivated without any data loss?

Spring 2019 Release Notes Deep Dive

Spring is in the air with flowers and rain and 500 pages of Release Notes. I’d like to highlight some of the features I’m looking forward to.

Dynamics 365 Finance and Operations

Expense Client Usability

I’m a fan of any UI refreshes in the application, especially the forms I have to personally use on a regular basis. I can already feel myself getting reimbursed faster.

Simplified View – Templates and Saved Views

These are additional UI improvements for allowing different groups of users to have different Form views. Seems like this will improve productivity; I hope there will be options to deploy the correct query/view from a Workspace or Menu item so users can get the appropriate Default view. It’s also unclear what options will be available via the X++ Development tools.

Enhanced Grid Experiences

There are a lot of forms in the Project module dealing with the Work Breakdown Structure or Subprojects that could benefit from fancy grid controls. Also, there are some “light weight” reporting scenarios that could be lit up using these controls.

Updated Navigation Bar that Aligns With Office Header

I have mixed feelings. I liked the menu path for screenshots and documentation. Hopefully the menu search being obvious is worth the trade off.

Developer Tools and Application Lifecycle Management

Lots of fantastic concepts in this article for developers, especially partners. Developer VMs can become a significant costs for developing for Dynamics 365 Finance and Operations, so reducing this cost is a plus. Also, having a Microsoft managed version of a Tier 1 environment could standardize some disparate processes.

Event-driven Architecture for Integrations

There are so many possibilities when adding Event driven architecture (think Microsoft Flow); the challenge sometimes is imagining and defining good business scenarios.

Finance and Operations, Entities in CDS for Apps

Since CDS was released in the April 2018, F&O has needed a more native integration. This is a welcome addition to the stack.

However, the release notes don’t specify if this kind of CDS integration can be customized using the development tools. I hope that’s part of the experience so we can light up scenarios outside those listed in the article.

One Version Experience

The Embedded Power BI tool looks interesting.

Business Intelligence (Power BI)

New Filter Experience

This is in regards to the Filter bar on the right side. I would guess most report consumers don’t even know this exists. Having a way to have it expanded and formatted will turn those types of filters into viable options.

Drill Between PBIX Reports

It’s been possible in the past to do a version of this using URL formulas and URL filtering. Will be good to have more built in options.

Performance Analyzer for Reports

Excellent idea, especially for DirectQuery based data connections or complicated DAX expressions.

Azure Machine Learning Integration

Nice to get options other than web services to consume Machine Learning models.

April – September 2019 Release Notes For Dynamics and Powers

Check out the latest features for all your favorite Dynamics and Powers!


Pro tip: The first article in every section contains the Estimated release date. I suggest looking at feature from that article so you also know when to expect them.

For example the F&O article: https://docs.microsoft.com/en-us/business-applications-release-notes/april19/dynamics365-finance-operations/planned-features

Editing Your Professional Selfie

I’m a big fan of having a good professional picture for LinkedIn, Microsoft Teams, and other work-related online presence tools; as I’ve written about before. Many times people have pictures of themselves they like, but perhaps don’t have a professional background (because of the beach scene behind you).

Recently I’ve run across a couple of tools that within a few minutes can edit that vacation picture into a professional selfie.

Background Removal

I’ve tried to do background removal before in Photoshop, and that experience made me hate Photoshop with the fire of a thousand suns. But I found a free online tool called https://www.remove.bg/ that does the background removal automagically, only keeping a person in the shot! The process is simple, just upload your photo and download the result, sans background.

Remove.bg Screenshot

Note: I’ve noticed this website struggles removing the background between open earrings, but handles hair fairly well.

Background Addition

Now that you’ve removed that beach scene, you need to replace it with something, so you need a photo editor. (No, I’m still not using Photoshop. Still hate it and it’s not free.) For this step there’s a free online photo editor called LunaPic https://www.lunapic.com/.

Upload the photo from the Background Removal step, then navigate to Draw menu > Background Tool.

LunaPic Image 1.png

Then click on “use our patterns or colors“.

LunaPic Image 2.png

Now pick a color. Black, white, and grey are all excellent options. Click the Apply button when you’re happy with the color and save the photo.

Original Photo

Joel Leichty with Busy Background

Updated Photo

Here’s the result after removing the background and replacing it with a black one.

Joel Leichty with Black Background

More Colors

One other idea I had for colors is to use your company’s branding colors for the  background. Here’s the same image as above using SAGlobal Blue.

Joel Leichty with Blue Background


LunaPic also has a simple cropping tool (Edit > Simple Crop Tool) – you’ll want to do a square crop and your eyes should be approximately 1/3rd the way down from the top.

LunaPic Image 3.png

Additional Examples

Here are some other photos taken with various cameras and settings showing the possible results. I tried to use some more complex background examples to show the results – in same cases it’s not perfect (my hair is losing some “spike”), but in general I feel this works quite nicely for a small profile picture.

I’m a dork.

Now I’m a dork with piercing eyes.

A recent picture going from a grey background to an SAGlobal theme color background.


Good luck; hope to see your smiling faces online!

PUG Summit | Understanding Time Intelligence with Power BI

Presenter: Dan Edwards

Auto Date Fields

Power BI can create automatic date hierarchies, for report and drill down by Year/Quarter/Month/Day. It’s important to consider whether your data model has more than one fact table with a date attribute. If there are multiple facts, or you have already created a date table, it’s a better to use your own date dimension.

“Don’t use auto date/time” -Dan

I love these types of tips and tricks – here’s how it works, and don’t do it!

Creating a Date Table with DAX

It’s possible to use a DAX expression to create a date table. The initial DAX expression looks like this:

Date = CALENDAR(“1/1/2016”, “12/31/2019”)

Use the DAX expression to create a New table in Power BI.


Then additional columns can be added to the Date dimension table:

Month = MONTH(‘DATE'[Date])


It’s also possible to do concepts like MonthDate where you calculate a Date column with the first day of every month, which can provide flexibility.

MonthDate = DATE( YEAR(‘DATE'[Date]) , MONTH(‘DATE'[Date]) , 1 )


Using an Effective Date

One of the scenarios is a scenario where the user wants to pick the effective date – for example a cutoff date or the last 12 months.

Dan mentioned he has a fairly extensive blog post on how to implement this concept.


Great presentation!

« Older Entries