Data Insights Summit Details – Day 1 Summary

With the Microsoft Data Insights Summit that is currently happening in Seattle the Power BI team has been really busy letting us know what features are coming and what to get excited about in the coming months, so below is a quick overview of what has been released after Day 1.

What is coming

As you can see below there are a whole host of details around what is now available and what will be completed in the next quarter.

Drill through Pages

This is one of the announcements that have created quite a bit of excitement, in that very soon you will have the capability to be able to drill through to other pages. But not only that when you do drill through it will remember what you selected or filtered and use this on your drill through page. So now you can drill through, as well as go back to your previous page.

I personally have been asked about this before and I know that it is something that people have been waiting for. As well as this can make the entire reporting experience a lot better and interactive.

Organizational Folders

It appears that you will now be able to organize your folders as you could previously do with SSAS OLAP

Power BI Write back with Power Apps and Visio Custom Visual

This is a big one, where they have now used Power Apps in order to facilitate a write back of your data into your Existing Power BI Model. This is something that people have been asking for, for a long time.

As well as now you can also integrate Visio visuals into your Power BI report, and if you create your Visio visuals with ID’s you can map these to your data so that they will interact as you can currently do with all other visuals within your report canvas.

Azure Analysis Web Designer

There is a preview coming where you can now design and tune Azure Analysis Services from within your Web Browser.

The things to take a note of is that you can import Power BI Desktop files which will be converted into Azure Analysis Services, which means you can create a proof of concept locally and then enable it to be used for the enterprise.

As well as then integrate these datasets with Power BI, Excel, Visual Studio and GitHub, so if you are looking for more source control around your development this might be the option going forward.

BI-RoundUp – Power BI (Office 365 Adoption Content Pack – Embedded Accelerator) – Excel (Get & Transform Updates May 2017)

This will no doubt be a quieter week, leading up towards the end of May and into June when there will be the next wave of updates from the Microsoft Power BI Team

You might also notice that I have changed the name from BI-NSIGHT to BI-Roundup, as there was another blogger who has his blog URL as BiInsights, so rather than make it confusing I thought to change the weekly update name.

Power BI – Office 365 Adoption Content Pack

There is a new content pack for Power BI, which will leverage off of the Office 365 reporting, so that you can gain some insights into how your organization is adopting Office 365.

You can find more details here: Explore your Office 365 Adoption Data in Power BI

Power BI – Embedded Accelerator

If you are looking to use Power BI Embedded, Microsoft have a limited offer to help you get up and running.

You can find the blog post here: Power BI Embedded Accelerator

Excel – Get & Transform Updates May 2017

While the features below have been available in Power BI, it is great to see them also incorporated into Excel, as these are some really useful updates.

The first one is the auto selection of the delimiter when using the Split By, I have been using this for a while and whilst it does not appear to be time consuming it is awesome to have it pre-selected for you.

The second one is when combining files to be able to select which sample file to use from a folder.

And finally you can now connect to DB2

You can find more details here: May 2017 updates for Get & Transform in Excel 2016 and the Power Query add-in

Power BI – Free vs Pro Infographic

I have been active on the Power BI Community Page for quite some time, and what I have often seen is people not quite sure what options are free and what options require a Pro license.

So here is my infographic in which I have put down which options are free and which options will require a Pro license.

I am hopeful that people will find this useful in understanding which options are free and which options require a Pro license.

If I have left anything out, or something is wrong please let me know and I will update it.

As well as I will keep this infographic up to date as there no doubt will be some additions to the Power BI Service.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You can access the images from the following link: Power BI Free vs Pro Infographic – Latest Version

Power Query – Adding Parameters within a piece of text

Below is where I had a situation where I wanted to put in a parameter within a piece of text. This was so that I could then dynamically change the Month Version for my budget and when I refreshed my data it would then use my specific Month Version. This was due to the requirement being that they wanted the ability to select ANY Month Budget Version.

Example

  • I had a requirement where I wanted to use a parameter value, but it would form part of a complete part of text. And as shown below in this example it would be for Mar (March)
  • I wanted the Output to look like the following:
    • Budget_Mar_YR1
  • And the part which is part of the variable is highlighted in BLUE above “Mar
  • I also wanted to re-use this for multiple conditions later in my script.
    • I required it for the following:
      • CY – This is for the Current Year
      • YR1 – This is for the following Year 1, so if I am in 2016 it would be for Year 2017
      • YR2 – This is for the following Year 2, so if I am in 2016 it would be for Year 2018
      • YR3 – This is for the following Year 3, so if I am in 2016 it would be for Year 2019

Solution

In order to do this, I went into the Advanced Editor in the Query Editor.

The name of my Parameter was calledBudget Version“, so when using it in the Advanced Editor it would be used with the following syntax below.

#”Budget Version”

In the section below is where I now defined by additional conditions, so that they would be dynamic. An explanation will follow afterwards.

BudgetVersionCY = “Budget_”&#” Budget Version”&“_CY”,

BudgetVersionYR1 = “Budget_”&#” Budget Version”&”_YR1″,

BudgetVersionYR2= ” Budget _”&#” Budget Version”&”_ YR2″,

BudgetVersionYR3= ” Budget _”&#” Budget Version”&”_ YR3″,

As you can see above each line was compromised of the following:

  • I defined our name highlighted in RED
    • BudgetVersionCY
  • Then I started with what our name was, which is highlighted in BLUE
    • “Budget_”
  • Next is where I inserted our Parameter highlighted in PURPLE
    • &#” Budget Version”&
    • NOTE: When you want to add additional TEXT or parameters you have to open it with the ampersand “&” as well as close it off (or end it) with an ampersand “&” also.
  • And then finally I added some more text at the end highlighted in BLUE again.
    • “_CY”

Then later in my query is where I put in my conditional statements into my Conditional Column as shown below.

#”Filtered Rows” = Table.SelectRows(#”Added Custom2″, each ([Budget Version] = #”
BudgetVersionCY
” or [Budget Version] = #” BudgetVersionYR1” or [Budget Version] = #” BudgetVersionYR2” or [Budget Version] = #” BudgetVersionY3“)),

Final Note

Just one thing to note, is when I put in the following syntax into my Query Editor you will lose the capability to edit it by using the settings or Gear icon

BI-NSIGHT – Power BI (Microsoft Flow & Power BI, Webinar How Microsoft Handles Power BI)

I have no doubt that as the year moves closer to the end of the year there will be slightly less news and updates. But with that being said here are this weeks updates.

Power BI – Microsoft Flow and Power BI

I have been personally looking at Microsoft Flow lately and it can really automate many tasks, as well as do things for you. And it is very easy to use Microsoft Flow.

And now they have added the Data Alerting from Power BI into Microsoft Flow. This is really awesome, because what it now means is that you can leverage all the capabilities from Microsoft Flow when there is a data alert.

For example you can now forward the alert to an email group. Or do a whole host of other options in Microsoft Flow.

You can read all about it here: Turn insight into action using Microsoft Flow and Power BI

Power BI – Webinar on How Microsoft Handles Power BI

This looks to be an awesome Webinar and one that I will definitely be watching. It is going to be great to see how they go about making it work so well.

You can find the details here: Power BI Webinar 11/29 How Microsoft BI Team manages Power BI

Power BI Quick Tip – Using Parameters in Power Query Filters

I have been working lately quite a bit in Power Query and having to shape and re-create data based on the requirements.

They had a requirement to make the data dynamic and immediately the Parameters in Power BI came to mind to create the solution.

Now as we know using Parameters in Power BI has a lot of advantages.

But one quick tip that I want to share or highlight is that your parameters can be used in quite a few places in Power Query.

And in this tip, it is using your parameters to dynamically filter data in Power Query.

By doing so, your data that loads will then be dynamically driven by what you specify in your parameter.

Example

Here is an example below.

I created a parameter called Year Version (Which is the last 2 digits of the year).

I gave it the type of Decimal Number.

I then gave it a number of 18. As shown below.

Next I went into my table and went to my column called Data Year that I wanted to dynamically filter my Data Year with my parameter.

I think clicked on the column and selected Number Filters, then Greater Than Or Equal To

This then brings up the Filter Rows Window

Now the magic of the tip is in this next section below. If you look at below, it appears to me that your ONLY option is to put in a value.

BUT if you click on the drop down you now get 3 options!

Now I clicked on the option and changed it to Parameter. I then selected my Year Version parameter from above.

And now my data only show data after and including Data Year 18. And if I change my parameter, it will then dynamically
update my filtered data.

Power BI Service – How to disable Analyze in Excel (Disable Users from Downloading any data from Power BI)

I was recently looking how to help out in the Power BI Community where there was a question around how to disable users from having the ability to disable Analyze in Excel in the Power BI Service.

This could be a very valid situation where you do not want users the ability to export or download any data from the Power BI Service, but rather only have a view of the data, this is how you can achieve this. This includes the Export Data Option on the visuals.

NOTE: When you make this change it does the change for your entire Tenant. So please be aware of this.

A work around might to be enable Row Level Security, so that only the users who have access to the data can see the data. The result would then be when a user uses the Analyze in Excel and they browse the data, they will get data returned based on their security.

Change Tenant Settings

The first thing is that you will need to have access to the Admin Portal in the Power BI Service.

To see if you are an Admin you should see the option below.

Click on Settings to see the list of settings options.

If you can see the Admin Portal, click on the Admin Portal.

Now once in the Admin Portal you will need to click on the Tenant settings as shown below.

Next scroll down and change the following options:

  • Export data to Off
  • Allow users to use Analyze in Excel with on-premises datasets to Off

This is shown below.

NOTE: You have to have to both settings above set to Off for the Analyze in Excel option to be removed.

Then click Apply at the bottom of the page.

After you click Apply you will get a notification letting you know that it will take typically 5-10 minutes for the changes to take effect.

Once the 5-10 minutes is up you can then go back into your reports or datasets and you will see that the option for Analyze in Excel is now longer there.

Conclusion

So by changing the Tenant settings as explained above, your users will no longer have the ability to export any data from the Power BI Service, either by using the Export Data option on a visual, or the Analyze in Excel option on the Reports or Datasets.

BI-NSIGHT – Power BI (Mobile Apps Update, Custom Visual Tool Development Update, Dynamic Security Cheat Sheet, JavaScript API, Infer Content Pack) – Microsoft Flow (Available to Everyone) – SQL Server Analysis Services 2016 (Tabular Editor)

Another great week in the world of BI.

Power BI – Mobile Apps Update for August 2016

Another month goes by and some more updates, this time from the Mobile Apps team.

In this update they have done quite a lot of work with regards to the ability to do manual refreshing of your data in iOS if you have a direct query.

The ability to use your favourite dashboard on all platforms, which is very handy when you have your selected items that you want to view, quite possibly from different data sets, but in one easy to view dashboard.

They have also made the data classification visible if you have enabled your data in the mobile app, so that the users are aware in terms of what the status is if the data they are looking at.

The new focus mode for iPad which makes it easier to view the data you want to very easily.

And finally the ability to create data driven alerts from within the Mobile App.

You can find all the details here: Power BI Mobile Apps feature summary – August 2016

Power BI – Custom Visuals Tool Development Update

I am not a custom visual developer myself but having recently worked with some developers it is great to see the updates and additions that they have added. I have no doubt that this will make the custom visual development a lot easier and extensible as we move forward.

You can find all the details here as to what has changed, updated and added: Custom visual developer tool now Generally Available

Power BI – Dynamic Security Cheat Sheet

Kasper De Jonge, has created another great blog post in which he shows how to create and use Dynamic security in Power BI.

He explains exactly how he did it, and even has a working example that you can download and try.

Here is the blog post with the details: Power BI Desktop Dynamic security cheat sheet

Power BI – JavaScript API for Power BI reports.

The guys from the Power BI team are a very busy team. And now they have released the Javascript API which will enable you not only to embed your Power BI report into an iFrame but also enable your page to interact with the Power BI reports.

You can find all the details here: Interact with Power BI reports using the JavaScript API

Power BI – Infer Content Pack

Here is another content pack and I am sure if you are existing Infer client then this will be a very welcome addition.

Not only that but in terms of what Infer does in providing predictive technologies, I am sure that over time the dashboards will become more valuable to your business.

You can find all the details here: Explore and Analyze your Infer data with Power BI

Microsoft Flow – Available to Everyone

I have played around with Microsoft Flow and it is a great product and really easy to use when you want to automate tasks, as well as possibly get data from a site, OData feed etc and store it in a location. This is very easily achievable with Microsoft Flow.

They now have made it Generally available to everyone, even if you do not have a work or school account.

You can find the details here: Microsoft Flow now available for everyone

SQL Server Analysis Services 2016 – Tabular Editor

For the people using SQL Server Analysis Services in compatibility mode 1200 there is a great blog post, as well as details about the application that Daniel Otykier has created.

It makes it a lot easier and simpler to create and use Tabular Models, now that it uses the new JSON format.

You can find all the details here on what he has done. It does look very promising indeed.

A new way to work with SQL Server Tabular Models: The Tabular Editor

Create Dynamic Periods for Fiscal or Calendar Dates in Power BI

I came across Chris Webb’s excellent post (Creating Current Day, Week, Month And Year Reports In Power BI Using Bidirectional Cross-Filtering And M) in which he demonstrated how to leverage the Bi-Directional filtering in Power BI. Chris goes into great detail to explain how he goes about creating the functions, tables and how it all pieces together.

This got me thinking and I came up with a way to have both Fiscal or Calendar Date Slicers in Power BI. So in the steps below I will show you how I extended on what Chris Webb did, to make things easier. As well in a later blog post to leverage the Fiscal or Calendar dates for when displaying Month names on a chart visual.

I then had the opportunity to present at the Power BI User Group in Brisbane and below is what I presented to the people who attended.

Below is an example showing how it dynamically switches between the Fiscal and Calendar Months. The thing you will notice is how the Month Names change when changing from LY to LY Fiscal. Which dynamically switches between the Fiscal and Calendar Months.

NOTE: Please click on the GIF below if it is too small to see what is happening.

fiscal-calendar-change

Part 1 – Starting with the default Calendar Dates from Chris Webb’s blog post

The first thing that I did was to download the workbook example from the blog post, which you can also download from here DynamicDateSelections.pbix

This is a quick overview in terms of what was detailed in Chris Webb’s blog post.

Creating the Function in Power Query

The first explanation is how Chris created the function in Power Query.

I start with the function first which is shown below. This is the function that requires the parameters below, and in turn creates the Period table.

As you can see above it requires the following parameters, Period Name, Start Date, End Date and Sort Order which are explained below:

  • Period Name is for the Date range for the Period
    • EG: YTD (Year to Date)
  • Start Date is for the start date for your Period (YTD)
    • EG: 01-01-2016
  • End Date is for the end date for your Period (YTD)
    • EG: If today’s date is 06 Sep 2016 the End Date would be 06-09-2016
  • Sort Order is how you want to sort our Periods

Creating the Period Table in Power Query

Next is the actual code that will generate the values to be passed through to the function. Which in turn will create the period table.

Below is a simple example of the Power Query Code “M” which has to examples for Today’s Date, and YTD

What is happening above is the following

  • First it is getting Todays Date
    • With this example Todays Date will be 06 Sep 2016
  • Next is where it is defining the range of dates
    • This is where you can define all of your periods.
    • As with our example I have only shown 2 above.
  • Then within the range is where I am putting in the required parameters for the function above as explained below using the YTD example
    • The function first Parameter called
      Period Name
      • So with our YTD this is shown above with
    • Next the second
      Parameter is called Start
      Date which is where I get the first date of the year, using the inbuilt Power Query formula
      • In here we start from the inside out.
        • So the first part is getting todays date 06-09-2016
        • Next using the Power Query formula Date.StartOfYear is saying get the First Date of the Year
          • 01-01-2016
        • And then finally convert this to a date by using the Power Query formula Date.From
      • So once this is done, it will give the Start Date of 01-01-2016
      • And every time you refresh this, it will check your current date and adjust accordingly.
    • The third parameter is called End Date, which is where I get todays Date
      • So this will be 06-09-2016
    • And the final parameter is the Sort Order, which is the order that it will be shown.
      • So this is saying it will be shown second.
  • Then it then using the Power Query Formula to get a list from the range and pass it to the CreatePeriodTable function, and output that into the GetTables
    • The refers to the parameter values from within the range.
  • And then finally it outputs the data and combines it all into one table.

So once the above is done this is what table looked like:

NOTE: Relationship between Period and Date Table

I just wanted to make a quick note, that as per Chris’s blog post there is already the relationship defined between the Period and Date table as shown below:

Part 2 – Extending the Function & Period Table to cater for Fiscal or Calendar Dates

In this next section below I am going to explain how I extended both the function and the Period table to cater for if it is a fiscal or calendar date.

Below is what the final output looks like in the Period Table

Extending the Function

What I did was to extend the function to accept one more parameter which is the Period Type.

So below is the actual code that I modified in the Advanced Editor in Power Query

(

PeriodName as text,

StartDate as date,

EndDate as date,

SortOrder as number,

PeriodType as text

) as table =>

let

DayCount = Duration.Days(EndDate-StartDate)+1,

DateList = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),

AddPeriodName = List.Transform(DateList,

each {PeriodName,_,SortOrder,PeriodType}),

CreateTable = #table(

type table[Period=text, Date=date, Sort=number,PeriodType=text],

AddPeriodName)

in

CreateTable

As you can see above I added the Period Type as required, it is highlighted in RED above.

So when complete and looking at it in Power Query it now has the additional parameter

Extending the Period Table

Now in order to extend the period table I needed to add in the additional parameter as shown below:

let

TodaysDate = Date.From(“06-09-2016”),

Ranges = {

{“Today”,

TodaysDate,

TodaysDate,

1,

“Calendar”},

{“YTD”,

Date.From(Date.StartOfYear(TodaysDate)),

TodaysDate,

2,

“Calendar”}

},

GetTables = List.Transform(Ranges,

each CreatePeriodTable(_{0}, _{1}, _{2}, _{3},_{4})),

Output = Table.Combine(GetTables)

in

Output

  • So in order to make the required changes I did the following.
    • I added in the additional field after the sort order “Calendar”, highlighted in RED
  • And then when passing the values to the CreatePeriodFunction I had to specify the additional parameter value, highlighted in ORANGE

So now when you see the Period table it looks like the following:

Part 3 – Adding in Parameters for Fiscal Start and End Months

In this section what I did to make it easier was to add in parameters for the start and end fiscal months.

As well as modify the underlying Power Query M code, to take this into account.

Creating the Parameters

I created the following 2 Parameters as shown below:

Modifying Power Query M Code for Parameters

Next is where I added the following into the Power Query M code, so that it would be dynamic in terms of always using the correct Fiscal start and end months.

Below is the code and an explanation of what I did.

The reason for doing it this way, is that I have now defined it once and can re-use it anywhere else within my Power Query M Code.

let

TodaysDate = Date.From(DateTimeZone.FixedUtcNow()),

YearText = Number.ToText(2000),

FiscalStartMonth = Date.Month(Date.FromText(“”&YearText&”-“&#”Fiscal Start Month”&“”)),

FiscalStartMonthDay = Date.Day(Date.StartOfMonth(Date.FromText(“”&YearText&”-“&#”Fiscal Start Month”&“”))),

FiscalEndMonth = Date.Month(Date.FromText(“”&YearText&”-“&#”Fiscal End Month”&“”)),

FiscalEndMonthDay = Date.Day(Date.EndOfMonth(Date.FromText(“”&YearText&”-“&#”Fiscal End Month”&“”))),

  • So what I did was to first create YearText
    • As you can see I used the Year 2000
    • The reason is that this is only used to actually get the Date formatted in the Fiscal requirements below
    • EG: In order to get a Month Number you need to have a valid date.
      • So if we have a date of 2000-07, we are only ever looking for the 07
  • Next I went and created the following
    • FiscalStartMonth – This is the Fiscal Month Start Number
      • EG: I wanted it to give me an output of 11
      • You will also see that I put in the Parameter highlighted in RED
        for the Fiscal Start Month
    • FiscalStartMonthDay – This is the first day of the Fiscal Month
      • EG: I wanted it to give me an output of 01
      • You will also see that I put in the Parameter highlighted in RED
        for the Fiscal Start Month
    • FiscalEndMonth – This is the Fiscal Month End Number
      • EG: I wanted it to give me an output of 10
      • You will also see that I put in the Parameter highlighted in ORANGE
        for the Fiscal End Month
    • FiscalEndMonthDay – This is the last day of the Fiscal Month
      • EG: I wanted it to give me an output of 31
      • You will also see that I put in the Parameter highlighted in ORANGE
        for the Fiscal End Month

Using the Values within my Period formula for Fiscal Dates

In this section below I will explain how I then created periods for Fiscal Dates.

The example below that I am going to show is for Fiscal Year – Last Year (FY-LY)

{“FY-LY”,

if Date.Month(TodaysDate) < FiscalStartMonth then #date(Date.Year(Date.AddYears(TodaysDate,-2)),FiscalStartMonth ,FiscalStartMonthDay) else #date(Date.Year(Date.AddYears(TodaysDate,-1)),FiscalStartMonth ,FiscalStartMonthDay),

if Date.Month(TodaysDate) < FiscalEndMonth then #date(Date.Year(Date.AddYears(TodaysDate,-1)),FiscalEndMonth ,FiscalEndMonthDay) else #date(Date.Year(Date.AddYears(TodaysDate,+0)),FiscalEndMonth ,FiscalEndMonthDay),

3,

“Fiscal”},

  • The first line is our Period Name “FY-LY”
  • Next is where I get the starting Period for our Fiscal Year for Last Year (01-07-2015)
    • As you can see above I have put in an if statement, in which I can validating todays Month Number, and if it is less than the FiscalStartMonth Then go back
      2 years, else go back 1 year
      • So for example if our Fiscal Start Month is July, the number will be 07.
      • So if today’s date is 06-09-2016, that means the Month number
        currently is 09
      • So based on the above, this is NOT
        true, so only go back One Year.
      • NOTE: You can see that because I am defining the #Date, I have to use the required format (YEAR,MONTH NUMBER,DAY) EG: #Date(2015,07,01)
  • Now I did the same for the Ending Period, but this time I changed it to use the FiscalEndMonth
    • NOTE: You can see that because I am defining the #Date, I have to use the required format (YEAR,MONTH NUMBER,DAY) EG: #Date(2016,06,31)
  • And then the final part is where I put the Period Type as “Fiscal” which will be explain further down below.
  • This ensures that I now get the correct Period Range for Fiscal Year Last Year.

Adding additional Period into the Period table.

In the steps below I am going to add the following period “Calendar Year – Last Year – Previous Quarter” (CY-LY-PQ)

What this means is that if the current date is 06-09-2016 then the range for CY-LY-PQ would be: April 2015 – June 2015

,

{“CY-LY-PQ”,

Date.AddYears(Date.AddQuarters(Date.StartOfQuarter(TodaysDate),-1),-1),

Date.AddYears(Date.AddQuarters(Date.EndOfQuarter(TodaysDate),-1),-1),

5,

“Calendar”}

  • What we are doing above is to get our Date ranges that we needed.

So now you can then load this table and close down the Power Query Editor, which will then load the data into your model.

And the reason for this is so that when you select an item from the Period Table it will flow via the Date table to the fact table.

Part 4 – Adding the Period Slicer and how it works

In the steps below I will show how to add the Period slicer and when selected how it changes the data dynamically.

  • Navigate to the Period table and then select the Period on the report canvas as shown below.
  • Then under the Visualizations change it to the Slicer
  • Then go into the Format and under General, change the Orientation to Horizontal
  • And then I formatted it under Items as shown below.
  • And then finally I turned the Header Off and gave it the following Title
  • So that once complete it looks like the following below.
  • Now when you select a Slicer your values will change dynamically.

NOTE: The thing to NOTE is that when you change between Fiscal and Calendar Periods the Months are not sorting correctly.

Part 5 – Adding Dynamic Months based on Fiscal or Calendar Periods

So in this step we are going to be creating a new calculated column so that if the period selected is Fiscal based, then it must use the Fiscal Month Names. And likewise if the period selected is Calendar based then use the Calendar Month Name.

We will also be adding the Month Sort Order so that it will be sorted correctly.

Creating the Month Name calculated Column

The first calculated column to add is the Month Name.

  • So what I did was to create a calculated column with the following DAX syntax, with an explanation afterwards.

    Month Name =

    IF (

    [PeriodType] = “Calendar”,

    RELATED ( ‘Date'[MonthName] ) & ” “,

    RELATED ( ‘Date'[Fiscal Month] )

    )

    • I am starting my DAX Calculated Measure with an IF statement highlighted in GREEN
      • The reason for using the IF statement is so that I can use it to decide if a value is True what to do, and if false then what to do.
    • Next is where I am specifying what to do if the Period Type = “Calendar” highlighted in LIGHT BLUE
      • And in this syntax I am getting the related Date Month Name .
      • This is so that my Month Name is unique across the dataset.
      • You will notice that there is a space at the end &” “
        • This is so that the concatenation between the calendar and fiscal month names are different.
        • This is to ensure later when we do the month sort order, because they are unique they will sort correctly.
      • NOTE: The reason for this is because in the next steps is where I want to sort the Month Names and in order to this I need a unique Source Column in order to do this.
    • Next is where I am specifying the FALSE portion of the IF Statement highlighted in ORANGE
      • NOTE: I do not need to next any more IF statements because my data has either Fiscal or Calendar.
      • And in this syntax I am getting the related Date Fiscal Month Name.
      • NOTE: The reason for this is because in the next steps is where I want to sort the Month Names and in order to this I need a unique Source Column in order to do this.
  • Now once that is done I could then see my Month Name
    column.

Creating the SortMonthNumber calculated Column

  • Now the critical part in order to show the correct dates is to have it in the correct sort order.
    • So with our example we want Calendar to be from Jan – Dec
    • And we want Fiscal to be from Jul – Jun
  • So I created the following calculated column with the following DAX syntax, with an explanation afterwards.

    SortMonthNumber =

    IF (

    [PeriodType] = “Calendar”,

    RELATED ( ‘Date'[Calendar Month Number] ),

    RELATED ( ‘Date'[Fiscal Month Number] )

    )

    • I am starting my DAX Calculated Measure with an IF statement highlighted in GREEN
      • The reason for using the IF statement is so that I can use it to decide if a value is True what to do, and if false then what to do.
    • Next is where I am specifying what to do if the Period Type = “Calendar” highlighted in LIGHT BLUE
      • And here is where I am getting the related Date Calendar Month Number.
    • Next is where I am specifying the FALSE portion of the IF Statement highlighted in ORANGE
      • NOTE: I do not need to next any more IF statements because my data has either Fiscal or Calendar.
      • And in here I am getting the related
        Date
        Fiscal Month Number.
  • This will then create my SortMonthNumber
    calculated
    column.
  • Next I ensured that the formatting was set to Whole Number as shown below.
  • And the final step was to now use this column for the Sort by Column for our Month Name
    calculated
    column we created above by configuring it as shown below:
  • Now all that I did was to change the Month used in my visual from the Date Table and the Month Name
    column to the Period Table and the Month Name column
  • And then when I clicked on my Slicer I got the expected
    results, as shown at the start of the post.

Changing the Month on the Visual

Now the next step is to change the bar chart from the Date Month, to the Month Name in the Period table.

  • To do this simply remove the Month from the visual.
  • And then add the Month Number
  • Now when you interact with the visual you will see it change correctly when selecting a Calendar or Fiscal Month.
  • NOTE: Here you can now show that the Fiscal Months are sorting correctly as they should.

Part 6 – Creating Period Measures easily

The final part is to show how easy it is to create measures using the Period ranges.

NOTE: Ideally you should already have your Periods created in your Period table.

So below I am going to show how to create the following Calculated Measures below

  • The first is to create a measure for Calendar Year – Last Year with the syntax below.

    Sales CY-LY =

    CALCULATE ( [Sales], Period[Period] = “CY-LY” )

    • As you can see what I did below was to use the Calculate and then filter it by the Period Name where it is “CY-LY”
  • The second is to create a measure for Calendar Year – YTD with the syntax below.

    Sales CY-YTD =

    CALCULATE ( [Sales], Period[Period] = “CY-YTD” )

    • As you can see what I did below was to use the Calculate and then filter it by the Period Name where it is “CY-LY”
  • Now I can use that as any calculated measure.

Now drag this into your report and show them how it works.

Create the following visual for this below:

NOTE: That is the Date Month

As you can see above we now have a comparison between Last Year (LY) and Year to Date (YTD)

You can download the example file here: World Wide Importers – Power BI – Completed.pbix

As well as if you want to view it on the Web here is the Publish To Web Version: Publish to Web | World Wide Importers – Power BI – Completed

If there are any comments or questions, please leave it below.

BI-NSIGHT – Power BI (Secure and Audit Power BI, Data Driven Parameters, Snowflake Data Connector) – Excel (Get & Transform Updates / Power Query Updates)

Here are the BI updates for this week.

Power BI – Secure and Audit Power BI

One of the questions that is regularly asked with regards to Power BI is around how secure the data is. And along with that is how do people gain access.

This new update goes a long way not only to make Power BI more secure. But also to have the ability to look at the audit logs and see who is doing what if required.

I have no doubt that this will go a long way in helping organizations secure their information, as well as be compliant from an audit perspective.

You can find the details here: Secure and Audit Power BI in Your Organization

Power BI – Data Driven Parameters

This is another great blog post by Chris Webb where he explains how to use the new updates in Power BI which enable you to now use Data Driven Parameters. So now you can dynamically have your requested parameters come from a list, which can be derived from an existing data set.

You can read up about it here: Data-Driven Power BI Desktop Parameters Using List Queries

Power BI – Snowflake Data Connector

In this blog post from the Microsoft Power BI team they explain what the Snowflake data connector is and how to connect and use it.

I am sure that it will be very welcome for the existing and potential Snowflake customers.

You can read up about it here: Power BI enables connectivity to Snowflake

Excel – Get & Transform Updates / Power Query Updates

IT is good to see that the Excel team has also found a way to keep on adding features and updates to the Get & transform or Power Query within Excel. I often find that they get released first to Power BI Desktop, but then they soon make it into Excel also.

This month there is a whole host of updates as shown below.

As you can see from above there are additional data connectors, as well as changes in the query editor. As well as finally making it easier to extract Date and Time functions from your existing columns. Which in the past can be rather tricky?

You can find all the details here: August 2016 updates for Get & Transform in Excel 2016 and the Power Query add-in