Tag Archives: Business Intelligence
PBIVIZ Single Line Toggle Format Option Tip
We can add various Visual Formatting Options while developing a Power BI Custom Visual. One of them is the Toggle feature which is useful for adding or removing particular abilities to your visual or perform any similar boolean operations. The json bit for the toggle option looks like this. By default when you add a toggle option, the option is available under a dropdown. To access the toggle option you will always have to click on the dropdown arrow. There is a neat little trick that can make you access the toggle button directly rather than clicking on the dropdown button every time. You only need to change the required toggle property name to “show”. Note: The object name for the toggle option needs to be changed to “show” in the visual.ts file as well. Your toggle option should look like this now!
Power BI Transport Layer Security Settings (TLS)
Introduction: The Transport Layer Security (TLS) is a protocol that provides Secure communications. There are different versions of this protocol with the latest one being TLS 1.2. With all the crazy updates that Microsoft comes with, many of the programs, web services. etc. have enforced TLS 1.2 to be mandatory for communicating over the network. The previous versions of TLS are not supported in many of these programs and sooner or later they will deprecate for sure. Lucky for us, after the October 2018 update, Power BI Desktop now respects this need for TLS 1.2 and recognizes the Windows registry key in your System. You can enable or disable which version of TLS protocol is needed and Power BI will use that version accordingly. Steps to disable older TLS: Open your regedit by searching for ‘regedit’ in the search box of the taskbar Note: Changes in the regedit can cause serious changes in your system. Please take a backup of your regedit before proceeding and import the backup just in case your system starts to act funny. Go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] and make the following changes [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] “Enabled”=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] “DisabledByDefault”=dword:00000001 This will disable your Power BI from using your older version of TLS 1.0 by default Steps to update your TLS to 1.2 Go to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] and make the following changes [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] “Enabled”=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] “DisabledByDefault”=dword:00000000 This will enforce your applications to use the latest TLS Power BI Desktop will respect the registry keys specified on those pages, and only create connections using the right version of TLS. For further documentation on TLS, you can refer the microsoft document below https://docs.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings
Count Number of weekends between 2 dates in SSRS
Problem: There is no in-built function in SSRS where we can count the number of Saturdays and Sundays between any two dates in SSRS. This is a needed function for scenarios where we only need to get a count of working days.’ Solution: Following is a formula that can be used for getting an accurate count of weekends. = (((DateDiff (DateInterval.Day, DateAdd(DateInterval.Day,7-WeekDay(Parameters!startDate.Value),Parameters!startDate.Value), DateAdd(DateInterval.Day,7-WeekDay(Parameters!endDate.Value),Parameters!endDate.Value).AddDays(1)) + 1)/ 7)*2) + iif(weekday(Parameters!endDate.Value)=7,1,0) + iif(weekday(Parameters!startDate.Value)=1,1,0) -1 Here instead of Parameters!startDate.Value and Parameters!endDate.Value, you can use any other Start Date or End Date.
Generating Image dynamically in SSRS Report from CRM
Introduction: It is possible to Fetch images from CRM’s entity records using Fetch XML. This can be done using Notes attachment in CRM and the steps to display the Image in your report are pretty simple as well. Steps: Attach your image to a note under your respective entity in CRM In your Visual Studio copy paste the following code in your Query Designer <fetch mapping=”logical” output-format=”xml-platform” version=”1.0″> <entity name=”annotation”> <attribute name=”subject”/> <attribute name=”notetext”/> <attribute name=”filename”/> <attribute name=”filesize”/> <attribute name=”documentbody”/> <attribute name=”annotationid”/> <attribute name=”mimetype”/> <attribute name=”objectid”/> <filter type=”and”> <condition attribute=”mimetype” value=”%image%” operator=”like”/> </filter> <order descending=”false” attribute=”subject”/> </entity> </fetch> Add an Image Control in your Report. If you want to generate multiple images then you can add the Image Control under a Table Go to Image properties and select the image source as Database. Under field select documentbody and select your MIME type to whichever image format you want it to be Click on preview and your image should be rendered in your report Conclusion: Thus you can store images in your CRM and generate dynamic SSRS reports with these images easily.
Power BI April 2018 Update: Q&A Explorer
Introduction: In this blog we will explore some of the new features added to Power BI. Power BI has upgraded its Q&A Experience in its latest April release. It has simplified and simultaneously improved the natural language recognition process which is one of Power BI’s most powerful tools for Query Processing! Some of Q&A Explorers cool new Features: You can now add a simple image, shape or button which on being click can launch a Q&A Explorer! You just need to toggle the Q&A option on under Action for the particular image/shape/button. Adding a Q&A button can look something like this. On clicking on this newly created Q&A Explorer a dialog appears where the user can ask questions to generate dynamic visuals. To learn more about this feature you can view my previous blog on Natural Language Processing over here. You can add suggested questions which will show on the left side of the dialog when a user clicks on the Q&A button. When you click on Save and close these newly added Suggested Questions will get saved to this specific Q&A button. The Q&A Explorer can also return whole reports now when you search specific keywords. You can do this by going to a particular report and turning it’s Q&A Feature on in Page Information. Searching these keywords in the Q&A Explorer will return this particular report. Optionally, if you have page level filters then you can set Require single selection On for a particular filter. This filter will then be shown in the Dialog while searching for the queried report. Conclusion: These are some of the latest features added to Power BI’s arsenal. Q&A Explorer is an underused tool but if used correctly it can improve your interactive experience with your reports tremendously.
Azure Machine Learning Cheat Sheet
Introduction: Microsoft released a PDF cheat sheet of which machine learning algorithms can be used on Azure Machine Learning Studio. This Microsoft Azure Machine Learning Algorithm Cheat Sheet helps you choose the right machine learning algorithm for your predictive analytics solutions from the Microsoft Azure Machine Learning library of algorithms. The algorithms have been grouped in 5 different groups. These groups are: Regression: For predicting values. For Example when predicting a stocks price. Anomaly detection: For finding unusual data points. For example, any highly unusual credit card spending patterns which deviates from the normal credit card spending patterns. Clustering: The data points have no labels associated with them. Instead, the goal of an unsupervised learning algorithm is to organize the data in some way or to describe its structure. For example, discovering companies with similar marketing strategies. Two-class classification: When there are only two choices, it’s called two-class or binomial classification. For example distinguishing between a Cat or Dog. Multi-class classification: For predicting three or more categories. For Example predicting the winner of a Race. To read the cheat sheet, read the path and algorithm labels on the chart as “For <path label>, use <algorithm>.” For example, “For speed, use two class logistic regression.” Sometimes more than one branch applies. In this case it is better to create scored models with both the algorithm and compare both of their accuracy to decide which algorithm is the better fit. Even a beginner can easily use the cheat sheet provided to select which algorithm is apt for creating their predictive solution. There are some generalizations and oversimplifications, but it points you in a safe direction. It also means that there are lots of algorithms not listed here but these many algorithms are more than enough to give you a good head start in the ML world.
Connect your Azure Machine Learning Predictive Solution to Power BI
Introduction: Azure Machine Learning Studio is an amazing tool that lets us create efficient ML experiments with simple drag and drop features. We can predict anything from Flight Predictions to Churn Analysis. But what if we want to represent this predicted data a more visually appealing format? Well it is possible to do this by representing your predictions on Power BI! Pre-Requisites: Basic Understanding of Azure Machine Learning Studio. Basic Understanding of Power BI. A Blob Container created on Azure Storage. Steps: Create your Azure Machine Learning Experiment on Azure Machine Learning Studio. Convert your Training Experiment to a Predictive Experiment and Deploy it as a Web Service. We will create a Console application in Visual Studio and copy paste the code inside Batch Execution. For automation we can create automated data pipelines but for now we will just use a simple Console application. Remove the existing code from the Console Application and copy paste the Batch Execution code. Install the necessary Nuget Packages and also update the following parameters. – BaseURL will be the same. – Storage Account Name, Storage Account Key and Storage Container Name will be parameters that can be found in your Azure Blob Storage which was created. – Api Key can be found in the Web Experiment Page in Azure Machine Learning Studio. – The input path is the path where you have saved your input csvfile for Batch Execution. Your Input csv file should have all the features which you have used to train your experiment After you run your Console application a new output1results.csv file should get generated in your Blob Container. The output results should include the labels which your experiment generates in it’s output. It should include the Scored Labels and Scored Probabilities labels as well. Now you can get your data using Azure Blob Storage as your source in Power BI and use the columns in the output1result.csv file to generate your ML Predicted Reports. The Report can look something like this. I hope this blog helps you to combine Azure Machine Learning Studio and Power BI to create a powerful predictive solution.