DAX – Getting the Start Date of the following Week

I was recently doing some work for a customer where they wanted to compare their date to the start date of the following week. They also had a requirement to persist the data to the dataset.

I thought that this would be a good challenge to use DAX with a calculated column. I most certainly could do this using the Power Query Editor and M, but I always like to see if it is possible when it is a smaller and easier DAX calculation.

Below is the DAX to get the Start date for the following week

'Date'[Date] - WEEKDAY('Date'[Date],2)+8

As you can see below, as each week goes on, I have got the start date for the following week for each day of the current week.

If I wanted to change it and use the starting date of the current week and use it for all dates for the current week, I could change it with the following DAX calculation

'Date'[Date] - WEEKDAY('Date'[Date],2)+1

As always if there are any comments or suggestions please leave them in the comments section below.

BI-RoundUp – Power BI (Sep Update for Power BI Desktop – Dashboard Comments – Community Contribution to PowerShell Cmdlets – Power BI PowerShell Cmdlets available in Azure Cloud Shell)

Welcome to another week of my Power BI Round Up. And as expected there is another massive Power BI Desktop Update.

Power BI – September Update for Power BI Desktop

As always I am going to over the new features and highlight what I think is really relevant in terms of what has been released.

Reporting

With the added support for categorical fields on the X-Axis this now makes the scatter charts more flexible.


As shown above there now is the capability to be able to copy a single value, which will copy the value in its unformatted form, which could be used to put into a search of another application.

Whilst when using the Copy selection feature, it will copy everything that you have highlighted in your table or matrix. And when pasting this, it will keep the column headers as well as the formatting options which you can then paste into Excel or another program. This is really a great piece of functionality which makes it easier when certain data needs to be copied into another system.

There are now some built in report theme’s which are great for those people who just want to move from the default colours, but do not want to create their own custom themes.

Report Page Tooltips are now generally available meaning that you will not have to enable it as a preview feature.

Along with that as shown above there is now report page tooltips available for Cards.

There have also been additional improvements for accessibility in the formatting pane, making it easier to navigate, as well as when using the screen reader there is more support.

Analytics

This is a really big, BIG one having the ability to have aggregated tables in your data model. What this means is that you can have a highly aggregated table of your data which might answer 60 – 70% of the queries. When the queries are run they will use the data in the aggregated table, which in turn results in exceptionally super-fast query response times. And if it does not hit the aggregated table it will then go down to the source table, which could be imported or using Direct Query mode, which means then that the entire data model is actually very small but very fast.

There is a lot more to this, so I suggest reading up the documentation that is included in the blog post. But this is something that I have been waiting for and cannot wait to try it out and get it working.

Finally there is now support for RLS with Q&A, this means if you have had a dataset that has had Row Level Security (RLS) previously you could not use Q&A. This has now been fixed and Q&A is available which is awesome.

Data Connectivity

As shown above there is a new connector where you can connect to PDF files and it will attempt to extract table data from your PDF files.

There is now support for the SAP BW Connector measure properties

There is a new connector called dataflows which will soon be in limited preview which will allow users to connect to an existing data flow.

Data Preparation

As per my first image, and above, there is now Intellisense when going into the Advanced Editor in the Power Query Editor. This is so awesome. There have been so many times in the past when I have not known which M function to use. As well as having syntax errors, and a lot of that pain is now gone with having Intellisense.

The add columns from examples now supports text padding your data, as shown above you can pad the text with zeros for data where you want them all to have the same length.

It is interesting to see that right at the end of the blog post they highlighted that they are working on being able to copy visuals between PBIX files. How cool is that??

You can find all the blog post details here: Power BI Desktop September 2018 Feature Summary

Power BI – Dashboard Comments

This was announced at the Microsoft Business Applications Summit and it is great to see that you now can add comments to Power BI Dashboards, as well as individual tiles on the dashboard.

It is also great that you can tag people in the comments, which will then send an email or send a push notification to the Power BI Android and IOS Mobile App.

At the end of the blog post, they also indicated that this will be coming to the reports, so stay tuned.

You can find all the details here: Announcing Dashboard Comments in Power BI: Your new hub to discuss data and collaborate with others

Power BI – Community Contribution to the PowerShell Cmdlets

This is the first contribution from the Power BI Community which adds to the existing Power BI PowerShell management cmdlets. Where Kenichiro Nakamura has added functionality to work with datasets, tables and columns.

You can find a lot more detail in the blog post: Celebrating our first community contribution to the Power BI management cmdlets

Power BI – PowerShell Cmdlets available in Azure Cloud Shell

What this means is you can now use the Azure Cloud Shell to run the Power BI PowerShell Cmdlets. This also means that there is no need to try install and configure the required PowerShell modules, because this is all maintained in the Azure Cloud Shell.

I would suggest looking into the storage options because depending on how much storage you need, if you have an existing Azure Subscription this could be a very good option.

You can find more details on how the Azure Cloud Shell works, as well as the blog post details here: Power BI Management cmdlets in Azure Cloud Shell

Power BI Default Slicer Selection

I have recently had some discussions with regards on how to enable the default selection of a slicer which will always keep the slicer selection on the current month.

As is currently stands there is no out of the box way to change the slicer on a selection where it shows the actual date for each day. This is because currently you can only have the selection on a value that does not change at every data refresh.

My proposed solution below is to use a fixed value, which does not change each time the data is refreshed.

I always suggest that it is best practise to complete the fixed value in the Power Query Editor. The reason is twofold.

  • Firstly, it is a lot easier to use the Power Query M functions to get the output you require.
  • Second, it allows for better compression into the data model.

As always, I will use the working example below, where I want my slicer to always select the current month.

  • I already have got a date table created, which is another recommendation to have in every data model, and you can refer to my blog post Power BI – How to Easily Create Dynamic Date Table/Dimension with Fiscal Attributes using Power Query which explains how to create the date table.
  • Next, I create the column with Year-Month with the code below, and the reason for this is because there are 12 months that happen over every year, without having the Year and Month combination it will result in multiple “Current Months”
    Number.ToText( [Calendar Year]) & "-" & Number.ToText( [Calendar Month Number])

     

    • And this is what the column looked like.
  • My next column that I created was to get the current Year-Month combination, which I created with the following code below.
    • NOTE: The code below does appear to be quite long, but based on my blog post, I have parameters for the #”Time Offset in Hours”, this is so that I when the data is being refreshed in the Power BI Service, it will then update correctly and show the correct Year-Month combination.
      Number.ToText(Date.Year(DateTimeZone.FixedLocalNow()+ #duration(0,Number.From(#"Time Offset in Hours"),0,0))) & "-" & Number.ToText(Date.Month(Date.From(DateTimeZone.FixedLocalNow()+ #duration(0,Number.From(#"Time Offset in Hours"),0,0))))

       

    • And this is what the column looked like.
  • The final step in my process is to then create a conditional column to compare the two columns above and where they match it will then be the current month, and when it is not, it is another month.
    • Which results in a column which will then give me a fixed value which says “Current Month”
    • And this then allows me to use this in a slicer, so that every time the data is refreshed the fixed value of “Current Month” does not change, but it will move as time moves.
    • As an option I then removed the previous 2 columns that I used because they are no longer needed.

As always, I am sure that there is more than one way to do that, but for me completing it in each step allows me to view and see that it is working as expected. And then to ensure that I am getting the results I expect.

Comments or suggestions are welcome in the section below.

BI-RoundUp – Power BI (New Monitoring Capabilities for Power BI Premium – Developer Update for August – Webinar on New Power BI Tools)

Welcome to another week of the BI-RoundUp.

Power BI – New Monitoring Capabilities for Power BI Premium

As you can see above there now is an App which you can get for Free from the App Source which will get all your capacity metrics which you can then use to better understand how you and your users are using your Power BI Premium Capacity.

There was also an indication that additional metrics will be added such as Long Running Queries and Query Duration, which is great to see if there are particular queries which could be consuming CPU and memory.

If you are using the A SKU’s for Power BI Premium you can also use the above App to analyse your capacity.

All the details can be found here: New monitoring capabilities for Power BI Premium Capacities

Power BI – Developer Update for August

Power BI Embedded in Azure

As you can see above, there are once again a whole host of great improvements to the Power BI Development story.

There is now Multi-Geo support for ISV’s who require their customers data to be located in their specific regions.

Power BI Embedded is now integrated with Azure Diagnostics, which helps with better diagnosis of resource issues and what is the root cause of these issues.

As per the request from a lot of users, there now is the QPU metric available when using Power BI Embedded.

Embed Capabilities

Now you can create a customized error notification for your end users when your App is embedded, so that the users do not get confused when there is an error.

There is now a more detailed and indicative error message when you are developing your app, which should make the entire development experience that much better.

There is now also a new updated Power BI Embedded playground which is more integrated and shows you how to leverage the JavaScript API

And finally, you can now use the Power BI Rest APIs to integrate with the new App Workspace experience, which is great as it moves away from the tight integration with Office 365 groups

All the blog post details can be found here: Power BI Developer community August update

Power BI – Webinar on new Power BI Tools


Seth and Mike will be hosting a webinar with Chuck Sterling from the Microsoft Power BI Team where they will go through their wonderful tools that they have developed on www.powerbi.tips

I use a fair few of their tools, so this will be a great webinar to watch.

Details can be found here: 9/11 Webinar: New Power BI tools and new templates including a walkthrough of Cool Blue and the layout Purple Haze

What runs under the cover when I open Power BI Desktop

I am always interested in what happens under the covers when I open Power BI Desktop. So I did a little digging and I got the inspiration from Macro Russo when he did his Webinar as well as presented at the Queensland Power BI User Group on “My Power BI report is slow: what should I do?”

What happens when I click on Power BI Desktop.exe?

This is the list of associated processes that are opened when Power BI Desktop is started, which I will explain what they are below.

This is what it looks like for me when I am running Windows 10 and I have a look in the Task Manager under Processes

  • CefSharp.BrowserSubprocess
    • Because Power BI Desktop runs in the Power BI Service, which is essentially a website and all the visuals are rendered in a browser.
    • My understanding is that within Power BI Desktop it is simulating how it will run the Power BI Service.
    • As per Marco’s Webinar, if this consumes a lot of memory or CPU this is potentially why your Power BI Report is slow.
  • Console Windows Host
    • UPDATE (06 Sep 2018) – I got a reply from Amanda Cofsky from the Microsoft Power BI team, who said that the Console Windows Host is the “Analysis Services Engine Console Output”, which is generally used by the Microsoft Engineers for debugging purposes.
  • Microsoft Mashup Evaluation Container
    • This is the Power Query Engine.
    • This is responsible for processing all the steps in the Power Query Editor. Which gets data from my sources, transforms it and then loads it into my data model.
    • When I look at a Server where I have got the On-Premise Data Gateway installed I will see a lot of instances of the Microsoft Mashup Evaluation Container running. This is because this is where my data gets loaded and transformed into tables before sending to the Power BI Service.
    • This is the executable which is the starting point and container for all the processes that are run within Power BI Desktop.
    • This is where all the magic happens, it is an analytical data engine which leverages In-Memory technology to achieve incredible compression using the X-Velocity Engine and blazing fast query response times by loading all the data into memory.
    • This is where all the data gets loaded from Power Query into the data model.
    • This process can have the highest memory usage.
    • If I have an expensive DAX measure which must get most of its data from the storage engine I will see an increase in memory utilization and CPU during the evaluation and running of the DAX measure. Which once again as per Marco’s Webinar is a great indicator as to why my Power BI Report is slow.

I hope that this has given you some insights into what runs under the cover in Power BI Desktop and that there are quite a few moving parts that work together seamlessly to make the report creation and development experience so seamless and fast when developing Power BI Reports.

As always if there are any questions or you have more details and insights into the details above, please let me know and I will happily update the details in this blog post.

Thanks for reading!

BI-RoundUp – Power BI (On-Premise Data Gateway August)

This week has been rather quiet, but I have a feeling that if Power BI Desktop gets released next week, we will be back at it and have a whole host of updates.

Power BI – On-premise Data Gateway Update for August

In this month’s update there is additional improvements for Custom Data connectors.

And it also has got the August version of the Mashup Engine.

You can find all the details and content here: On-premises data gateway August update is now available

That is it for this week, short and sweet!

BI-RoundUp – Power BI (Report Server Update – Aug 2018 – Ask a Question Generally Available – URL Filter Improvements – Python Episode 1 – Multi-Geo Support for Power BI Embedded)

Here is the weekly roundup, and as always the Power BI team has been very busy over their summer releasing some incredible features.

Power BI – Report Server Update Aug 2018

I am not going to go through all of the updates to the Power BI Report Server, due to almost all of the functionality already being released in Power BI Desktop and the Power BI Service.

What I will say is that there is a lot of new features that have been released. And as at the time of the release it almost has parity with the August release of Power BI Desktop. This is once again an incredible effort by the Power BI team to get this all out.

Below are all the updates with links to the specific sections, and if you do use Power BI Report Server, I would suggest reading through the blog post.

 

REPORTING

Persistent Filters (Reset to Default) now works with Custom Visuals in the Power BI Service

I was pleasantly surprised today whilst working on an older Power BI Report which had a few Chiclet slicers, and when I changed the selection of the Chiclet slicer I got the option highlighted “Reset to default”

I was actually so excited that I created this blog post on the way home from work, I simply could not wait until tomorrow!

Now when I hover of the “Rest to default” it now has a different tooltip, which now says:

Previously it said the following below:

I then created a quick report and configured it with my favourite Custom Visuals which are from the Filter Category.

  • Standard Slicer
  • Text Filter
  • Chiclet Slicer
  • Hierarchy Slicer
  • Smart Filter –  NOTE: The smart filter works but appears to not display the value when coming back to the report.

The results were fantastic in that each and every Custom Visual now works with the Persistent Filters.

As always, I really enjoy the comments and suggestions that I get to my blog posts. So please leave them below.

BI-RoundUp – Power BI (Working with PowerShell in Power BI – Deprecation of Custom Visuals API 1.1)

Here is the weekly BI-RoundUp and at least this week it will be a quick read!

Power BI – Working with PowerShell in Power BI

I am not going to go into great detail here, due to Kay giving a detailed explanation how to use the PowerShell cmdlets.

What I will say is that after reading through the above blogpost and with the Power BI Team creating the PowerShell Modules, this means that you can install the module for Power BI, which will then allow you to leverage all the module items. I have been using PowerShell for a while and having the modules is a lot easier to use and get out the data you want.

I suggest reading through the blog post below, as I am certain there is something you will learn and can use in your organisation.

Blog Post link: Working with PowerShell in Power BI

Power BI – Deprecation of Custom Visuals for API 1.1

As shown above there will be a deprecation of support for the Custom Visuals API version 1.1

This will happen from 01 September, so I suggest people who have got old Custom Visuals read this blog post with the links on how to upgrade their Custom Visuals

Here is the blog post: Announcing the deprecation of custom visual’s API version 1.1 and older

Quick Tip Adding Search to the Default Slicer in my Power BI Report

I always am amazed that there is still so much to learn with Power BI.

This week’s blog post is short and sweet, I am going to demonstrate how to add searching to the Default Slicer in my Power BI Report.

The main reason that I required this, is because currently (14 Aug 2018) the persistent filters only works with the Out of the Box Slicers. I had a requirement to be able to search on my slicer items.

I added my slicer to my report and changed it to be a drop down

It then looked like the following below.

All I had to do to enable the search to work was to click on the ellipses (three buttons, burger dots etc) and click on Search

Now when I click on my Slicer items I get a search option.

I then search for my first name which returns the following below, which allows me to select my name and slice my report by my name.

How awesome is that! It was like finding a nugget of gold for me, something that was there all along, but never thought to use it in this way.

As always if you have any comments or suggestions please leave them in the section below.