• Push Your Outlook Calendar to Google Calendar with Microsoft Flow

    Sometimes you may want your Outlook Calendar events copied to Google Calendar. This can be done with a handful of clicks and Microsoft Flow. Additionally, this is completely free if you have Office 365.

    EDIT: Based on some comments, I would like to clarify that this template only works for copying over your calendar events when they are initially created, i.e. inserts. It does not process updates or changes to your calendar events. You will likely have to look into paid software for this functionality. I’ve changed the title from “Sync” to “Push” to reflect this.

    What is Microsoft Flow?

    Microsoft flow is the third piece of the Microsoft Power Platform:

    1. Power BI – Interactive analytics.
    2. PowerApps – Low-code mobile and web applications.
    3. Flow – User-friendly event integrations.

    The Power Platform is a set of tools aimed at business users that want capabilities that were originally limited to professional coders or BI developers.

    Out of the three, Microsoft Flow is the weirdest because it’s so granular. The unit of measure for Power BI is the report, the unit of measure for PowerApps is the application, and the unit of measure for Microsoft Flow is the flow or event trigger. And event triggers are really, really tiny.

    Essentially, a flow is a trigger and then a series of actions, much like you might map out with a flow chart. It functions similarly to IFTTT or Zapier. I think of it as the glue or connective tissue between different applications.

    In this post, we are going to glue together our Outlook Calendar to our Google Calendar.

    Why connect calendars?

    Back when I worked a normal job, I had two calendars: Office 365 for work and Google for home. Now that I work for myself, that’s a lot more complicated. Sometimes a customer will create an account for me in their network. Sometimes I’ll partner with other consultants and work as part of their team. And of course, I’ve got my own work email at eugene@sqlgene.com.

    I need all of these calendars to consolidate to one place. My natural inclination and personal preference is to put it all into Google. Now, there are sync apps available, but this sort of problem is a perfect use case. A calendar event is created in outlook, a flow is triggered, and that information is transferred to Google.

    Using Flow

    To use Flow, I simply went to https://flow.microsoft.com and searched for Google Calendar. The template search for Flow sorts by popularity, and unsurprisingly the top result was exactly what I wanted.

    image

    Once I selected the template, then I needed to log into my Google account.
    image

    Then I just needed to select the calendars from both accounts that I wanted to sync.
    image

    And that’s it! I was pleasantly surprised how easy it was to do, and I’m interested to see where else I can use Microsoft Flow.

  • DAX Error: The Expression Refers to Multiple Columns. Multiple Columns Cannot Be Converted to a Scalar Value.

    Promotion: Use code DAXERROR to save 10% off my course. Module 1 is free.

    Sometimes, when working with DAX, you might get the following error:

    The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

    This error occurs whenever the DAX engine was expecting a single value, or scalar, and instead received a table of values instead. This is an easy error to make because many DAX functions, such as FILTER, SUMMARIZE and ALL, return table values. There are three situations where this error commonly occurs:

    1. Assigning a table value to a measure or calculated column
    2. Forgetting to use a DAX aggregation
    3. Treating ALL or FILTER as an action, not a function

    In the rest of the post, we’ll cover each scenario and how to fix it.

    Assigning a table value to a measure or calculated column

    Let’s say that you were doing some analysis on the products table in the AdventureWorks sample database. In this case, maybe you want to only look at the black products. So you create a measure with the following code:

    BlackProducts = FILTER(Products, Products[Color] = “Black”)

    image

    One solution to this problem is instead of assigning the code to a measure, which is intended to display a single value, you can create a calculated table instead.

    To do so, go to Modeling –> New table in Power BI Desktop. Then ender the same code as before but for the calculated table. Now you will see a table filtered accordingly.
    image

    Forgetting to use a DAX aggregation

    Now, what if we actually did want a single value instead of a table? Let’s say we want to count the number of black products. In that case, we could wrap our code in an aggregation function, such as COUNTROWS which can take in a table and return a single value.

    CountOfBlackProducts = COUNTROWS(FILTER(Products, Products[Color] = “Black”))

    This code will return the count of all products, but only if they have black as the color.

    Treating ALL or FILTER as an action, not a function

    Sometimes, people will try to use functions like ALL or FILTER to filter information on the report. By themselves, these functions actually return a table. However, when they are used with CALCULATE and CALCULATETABLE then you can use them to filter your data appropriately.

    Want to learn more?

    If you want to learn more about DAX, then check out my free learning path and my paid Pluralsight course.