Category Archives: Power BI
Securing an API using OAuth 2.0 in Azure API Management Part 2
Part 2: Configuration of an Application (Client App) in Azure AD for Consumer Introduction Configuring OAuth 2.0 for your APIs hosted in Azure API Management adds an extra layer of security and prevents unauthorized access. This is a very important configuration form Security point of view for your Endpoints and is provided out of the box by Azure. This is the second part of a series of Blogs on Securing your API using OAuth 2.0 in Azure API Management. Please go through all the parts to find easy and detailed steps that will help you configure the OAuth 2.0 Authentication. Grant permissions in Azure AD Now that you have registered two applications to represent the API and the Developer Console, you need to grant permissions to allow the client-app to call the backend-app. Go to the Azure portal to grant permissions to your client application. Search for and select APP registrations. Choose your client app. Then in the list of pages for the app, select API permissions. Select Add a Permission. Under Select an API, select My APIs, and then find and select your backend-app. Under Delegated Permissions, select the appropriate permissions to your backend-app, then select Add permissions. Optionally, on the API permissions page, select Grant admin consent for <your-tenant-name> to grant consent on behalf of all users in this directory. Part 1: Configuration of Applications in Azure AD Part 2: Configuration of an Application (Client App) in Azure AD for Consumer Part 3: OAUTH 2.0 Server setup Part 4: Testing using Developer Portal and JWT Policy Configuration
Share Story :
Securing an API using OAuth 2.0 in Azure API Management
Part 1: Configuration of Applications in Azure AD Introduction Configuring OAuth 2.0 for your APIs hosted in Azure API Management adds an extra layer of security and prevents unauthorized access. This is a very important configuration form Security point of view for your Endpoints and is provided out of the box by Azure. This is the first part of a series of Blogs on Securing your API using OAuth 2.0 in Azure API Management. Please go through all the parts to find easy and detailed steps that will help you configure the OAuth 2.0 Authentication.Open Xrm Toolbox and add Tool “PowerBI option-Set Assistant” Register an application (Backend App) in Azure AD to represent the API To protect an API with Azure AD, the first step is to register an application in Azure AD that represents the API. Go to the Azure portal to register your application. Search for and select APP registrations. Select New registration. When the Register an application page appears, enter your application’s registration information: In the Name section, enter a meaningful application name that will be displayed to users of the app, such as backend-app. In the Supported account types section, select an option that suits your scenario Leave the Redirect URI section empty. Select Register to create the application. On the app Overview page, find the Application (client) ID value and record it for later. Select Expose an API and set the Application ID URI with the default value. Record this value for later. Select the Add a scope button to display the Add a scope page. Then create a new scope that’s supported by the API (for example, Files.Read). Finally, select the Add scope button to create the scope. Repeat this step to add all scopes supported by your API. When the scopes are created, make a note of them for use in a subsequent step. Register Consumer application in Azure AD to represent a client application (Client App) Every client application that calls the API needs to be registered as an application in Azure AD as well. In this example, the client application is the Developer Console in the API Management developer portal. Here’s how to register another application in Azure AD to represent the Developer Console. Go to the Azure portal to register your application. Search for and select APP registrations. Select New registration. When the Register an application page appears, enter your application’s registration information: In the Name section, enter a meaningful application name that will be displayed to users of the app, such as client-app. In the Supported account types section, select option as required. In the Redirect URI section, select Web and leave the URL field empty for now. Select Register to create the application. On the app Overview page, find the Application (client) ID value and record it for later. Now, create a client secret for this application to use in a subsequent step. From the list of pages for your client app, select Certificates & secrets, and select New client secret. Under Add a client secret, provide a Description. Choose when the key should expire, and select Add. When the secret is created, note the key value for use in a subsequent step. Part 1: Configuration of Applications in Azure AD Part 2: Configuration of an Application (Client App) in Azure AD for Consumer Part 3: OAUTH 2.0 Server setup Part 4: Testing using Developer Portal and JWT Policy Configuration
Share Story :
DAX For Relationships in Power BI
Hi everyone in this blog we will see the different DAX that are used to define or use the relationship between two tables. In Power BI there are two type of relationships 1. One to One (1:1) 2. One to Many (1:*) Now lets look at the DAX functions that we can use with these relationships. USERELATIONSHIP- Specifies the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. Syntax USERELATIONSHIP(<columnName1>,<columnName2>) Where, columnName1 The name of an existing column, using standard DAX syntax and fully qualified, that usually represents the many side of the relationship to be used; if the arguments are given in reverse order the function will swap them before using them. This argument cannot be an expression. columnName2 The name of an existing column, using standard DAX syntax and fully qualified, that usually represents the one side or lookup side of the relationship to be used; if the arguments are given in reverse order the function will swap them before using them. This argument cannot be an expression. Key Point The function returns no value; the function only enables the indicated relationship for the duration of the calculation. Example = CALCULATE(SUM(ISales[SalesAmount]), USERELATIONSHIP(Sales[ShippingDate], DateTime[Date])) Limitations USERELATIONSHIP can only be used in functions that take a filter as an argument. USERELATIONSHIP cannot be used when row level security is defined for the table in which the measure is included. RELATED – Returns a related value from another table. Syntax RELATED(<column>) Where, column – The column that contains the values you want to retrieve. Key Point A single value that is related to the current row. Example FILTER( ‘Sales_USD’, RELATED(‘Territory'[TerritoryCountry])<>”United States”) RELATEDTABLE Evaluates a table expression in a context modified by the given filters. Where, tableName – The name of an existing table using standard DAX syntax. It cannot be an expression. Key Point A table of values. Example = SUMX( RELATEDTABLE(‘Sales_USD’) , [Amount_USD]) Limitation The RELATEDTETABLE function changes the context in which the data is filtered, and evaluates the expression in the new context that you specify. This function is a shortcut for CALCULATETABLE function with no logical expression. This function is not supported for use in Direct Query mode when used in calculated columns or row-level security (RLS) rules. Hope this helps.
Share Story :
Create new aggregate measurement / Entity store in D365 Finance and Operation to be consumed in Power BI report in D365 Finance and Operations
In D365 there are several option to export/Import data like Data Entities, BYOD, Aggregate measurements/Entity store. In this blog we will learn How to create entity store in D365 Finance and operations. Aggregate Measurements/Entity Stores are use to create Power Bi reports with nearly Live data where user have option to set its recurrence that is how often you want to refresh entity store there is no need to manually refresh the data as per suggested Batch job will run for respective entity stores. You can also forcefully refresh data by pressing refresh button on entity store page. So lets start with development of aggregate measurements, aggregate dimensions. Add New aggregate measurements object to the project where we required Add required attributes Add required measures Add required dimensions Add dimensions where view of dimension and aggregate measurements are different Build The Model Refresh Entity store from D365 Finance and Operation Environment Verify that respected view is created for aggregate measurement Add New aggregate measurements object to the project where we required. In this step we need to right click on new item Now select aggregate measurement and name it as per requirement in our case its “CFSAggregateMeasrure” Now assign required views in table property of the aggregate measurement as follow In my case I have selected “InventOnHandByWarehouse” view. Add required attributes Now add required attribute by right click on Attributes and assign required field in attributes as follows Add required measures After adding attributes add dimensions same how we added other attributes as follows After adding measure assign required field to it and operation which you want to perform on that field (for example. :- count, Average, etc. ) Add required dimensions By default some of the dimensions are provided like company and date which are showed in screen shot. And assign required fields in relation of dimensions Add dimensions where view of dimension and aggregate measurements are different If dimensions needs different view we need to create new aggregate dimension as follows In my case name of aggregate dimension is “CFSAggregateDimension ” Now assign required view to dimension as follows. After this create new attributes and assign fields to that attributes as follows After adding new dimension attribute if required you can assign more than one field reference as follows After this step assign fields to the respective field reference as follows. Now select the respected attribute and select its usage property and change it as key which will make it as dimensional key which will be helpful while making relations. There are 3 options under usage property description of each as follows Key If you specify usage property as “key” system will define the key of the dimension using this attribute Parent If you specify usage property as “parent” system will parent child hierarchy with this field as parent level. Regular If you specify usage property as “Regular” ,this is an attribute without any special behavior and it is default value. After setting usage property attach this dimension to our aggregate measurement by dropping required aggregate measurement on dimension section of it. Now define its dimension attribute property as follows After this you need to make relationship among the views as follows Fact Dimension If you want to make desired aggregate dimension as fact dimension go to desired dimension in aggregate measurement and make set “is fact dimension” property to yes/No as follows Build The Model After this case build the model which is used for this development of project as follows Refresh Entity store from D365 Finance and Operation Environment After successful build go to environment page’s Entity store section using following navigation System administration >> setup >> entity store and refresh the desired entity On required entity please press the refresh button You can also set schedule to refresh this entity by selecting edit button and enable its automatic refresh toggle and the set its recurrence as follows Verify that respected view is created for aggregate measurement In final step go to your VM’s SSMS and look for Axdw database in which in view section look for views with your aggregate measurement and dimension and name as follows After select query you can see the data of that view Now your entity store is ready to consume by power bi reporting service. Thank You!
Share Story :
How you can prevent yourself from coming into the defaulter list
In this blog we will see how you can prevent yourself from coming into the defaulter list. Lets first understand the different criteria for a user to fall in defaulter list. The follow up date of the case is less than today’s date. The day difference between last notes added and follow up date is greater than 5 days. For critical priority case notes not added after every two hours. Now since we know the criteria we can make a habit of always looking at our assigned cases either when we logged in or while logging out so that our follow up dates will not miss. As notes on the case are very important not just for the defaulter list but for clients and management to get insights of what is happening on the case, we should put notes on every action we do on the case. Hope this helps.
Share Story :
Cash Position Report for a Professional Services Organization
In this post, I will talk about the importance of the Cash Position Report for any Professional Services Organization. The Cash Position is your current and forecasted ‘Cash in Hand’. The importance of having Cash in your bank account cannot be emphasized enough. It is important to understand the difference between Cash Flow and Cash in Hand as they are not the same. An organization can have a solid cash flow (which is revenue tied up in Receivables), but without money in the bank, it cannot operate. Let me go into this further as it’s the foundation of our conversation here. For any Professional Services organization, anywhere from 60 to 80% of the Monthly expenses are tied to Employee salaries. Paying salaries on time, every month is key to the organization’s credibility. Salaries need to happen on time, month after month, irrespective of your cash flow. They require cash on hand. In addition, any business planning, from HR Activities (a team lunch, an offsite meet) to Investing in the organization’s growth (new areas of business, developing expertise) also requires cash on hand. One more topic that I need to mention is the current pandemic. Many Projects are delayed, cancelled or on hold. From a business standpoint, this kind of unforeseen event can put a tremendous strain on its ability to continue operations. But while the current pandemic is an extreme scenario, businesses constantly face challenges as we operate on a global level (2004 Tsunami, 2008 Financial Meltdown are some recently examples). Cash on Hand can mean the difference between survival and going out of business. So we see that Cash on Hand is a Key Metric and hence should be reviewed regularly, ideally during a scheduled Management meeting on a recurring basis. At CloudFronts, we do this review every Monday morning. Our two and a half hour Monday morning Management meetings are literally run by numbers. Some of the Key Reports we review are Project Overview Report, Team Billable & Non-Billable Allocation Report, Support Metrics, Sales Pipeline, Outstanding Accounts Receivable Report, Forecasted AR Report, Cash Position Report. Each one of these is a PowerBI Report embedded into our Microsoft Teams Leadership Team Group. So what is the Cash Position Report? I will start with a simple equation and then delve into the details – Cash Position = Cash + AR – AP + Projected AR Now let’s walk through each of the Items in there and how we get that data – Cash on Hand – This is what is in your Bank Account when you run this Report (our report is updated every Monday morning before our weekly Management Meeting). We manually enter this data into the Report. AR – AR is your Accounts Receivable which includes all Customer Invoices that are due this month and have not yet been paid. This includes overdue invoices carried forward from the previous month as well. If an Invoice is Paid, then it goes into Cash on Hand. Our AR data comes from Dynamics 365 PSA Contract Invoicing Schedule for both Fixed Bid and Time & Materials Projects. Our Contract Invoicing Schedule is the Single source of truth for all our Project Services Invoicing. AP – AP is all Payables this month, including Salaries. It comes from our Accounting System which is currently QuickBooks Online. Projected AR – Projected Accounts Receivable are any Invoices that we will generate this month and that will be due this month. This data also becomes from our Contract Invoicing Schedule. For Fixed Bid, this is based on the Contract Billing Milestones and for Time & Materials, this data comes from the Team Member Allocations. At the top of the Report, you will see that the report is month wise. Hence as you move into the future months, you have less visibility into AR data, but rely on your Projected AR data. As you move into a month, the Projected AR starts becoming AR, which then becomes cash on hand and typically by the end of the month, Projected AR should be zero. This Report gives the Management Team a clear visibility of the company’s Cash Position over a period of time. For us, we are looking at six months into the future, but organizations can easily set this up for longer periods. By reviewing it regularly, in a scheduled meeting, you ensure there are no surprises and you have time to react well in advance. The benefits of such a report are further amplified when you consider its impact on our behaviour. During the pandemic, our No.1 priority has been to ensure we are a stable organization with the ability to operate through this pandemic. This report can give you that stability and allow you to stay productive and impact your team with a positive state of mind. If you are keen on understanding more about our Internal Systems that keep us running and growing, our Internal Systems page is a wonderful resource – https://www.cloudfronts.com/our-internal-systems/ CloudFronts is one of the leading Microsoft Partners globally on implementing Professional Services Automation on the Microsoft Dynamics 365 Platform. You can reach me on LinkedIn for any questions/queries or email me at ashah@cloudfronts.com
Share Story :
Load Option set from D365 CRM to Power BI data model
Steps: Open Xrm Toolbox and add Tool “PowerBI option-Set Assistant” Open the tool and Click on load entities, it will load all the entities. Select the entity and field name from which we want to retrieve data, click on “Create records for selected option sets”. It will prompt that it will create new entity, click on Yes and proceed.it will create a new entity for option set. Now go to power bi and create connection using OData feed. Now we can see,”gap_powerbioptionsetrefs” entity created and we can load this into power bi model. Hope this helps!
Share Story :
How do you get a latest Refresh Date in Microsoft Power BI report
In this blog we will learn how to get a last refresh date in Microsoft Power BI report. So, using this practice, we will know last data refresh and also knows the problem with dataset refresh. In order to get latest refresh dates, you have to follow the below steps. Step 1: Open your report in “Power BI Desktop”. Step 2: Click on Transform data, it will open Power query Step 3: Click on New Source, select Blank query. Step 4: Enter DAX expression: = DateTime.LocalNow() and also change the name Step 5: Before use its need to convert into To Table. Step 6: Rename the column name like DateTime Step 7: Click on Close & Apply Step 8: Drag the Datetime field in report and apply card level visualization. It will work when you refresh the whole model, it will not refresh the date when individual table refresh. Hope this helps!
Share Story :
Hiding Filter Pane in Power BI Reports
While viewing reports in Power BI service/ Power BI Desktop, Power BI provides a feature to eliminate the filter pane completely in order to provide a professional look. Here are the ways to Hiding Filter Pane in Power BI reports. 1.Show/Hide the filter pane from report readers. By default, the Filters pane is visible to the end-users. If we don’t want them to see it, we can select the eye icon next to Filters and hide it. 2. Turning on/off the filters from Settings. Steps: Open the Power BI Report in the desired workspace and go to the content section. Select More options (…), then select Settings for that report. Go to the Filtering Experience and disable both the options to hide the filter pane. 3. Showing the desired filters in a user-friendly manner: We can select the filters which we want to display to the end-user depending on the users requirement. Hover-over the filter icon on the right-hand corner to view the read-only filters. Whichever filter we do not want to display to the user, we can hide them in the filter section of the report. Hope this helps!
Share Story :
Modern Enterprise BI: Part 1
Power BI has some new features and Future Promises for Modern Enterprise applications in Business.