Posts

Showing posts with the label Power BI Desktop

Donate

How To Setup Or Configure Row-Level Security (RLS) In Power BI Using Domain Credentials

Image
Good Evening All! While I was creating a Power BI report last year,I was tasked to make a report restrict information for a given set of users in our organization. After googling for a few minutes or so, most of the results were pointing me to Row-Level Security. One of the few points mentioned by Microsoft's RLS documentation is that members of a workspace defined in the Power BI service have access to the datasets. In which case are the admins of the workspace. In this report project we have to restrict data through domain account emails. So to start setting up RLS, I need to tweak some settings for both Power BI Desktop and Power BI Service. I. Power BI Desktop 1. In my sample report, click on Modelling menu then choose Manage Roles. 2. Add New Role called Supervisor Information then click Create. 3. Select Supervisor Information Dataset that contains email or information that will be used to Filter data based on a current role. In this case, I chose the Supervisor Informati...

Power BI Add Leading Zero (0) To Month In DirectQuery

Image
Good noon! I was recently confronted with an issue on dates not sorted correctly of which a date with this value 2020/10 (October 2020) appears in between of 2020/2 and 2020/1. This was based from an article I read on how to change the current date into a Current Month string and the data type for this calculated column is Text . As you can see from the image below, month of November which is the current month is translated as " Current Month ". But October 2020 is in between January and February 2020 respectively. And here's the calculated column DAX script. Current Month = IF ( MONTH ( 'SalesOrder' [OrderDate] ) = MONTH ( NOW () ) && YEAR ( 'SalesOrder' [OrderDate] ) = YEAR ( NOW () ), "Current Month" , YEAR ( SalesOrder[OrderDate] ) & "/" & MONTH ( SalesOrder[OrderDate] ) ) Since my datasource came from SQL Server database and the storage mode is DirectQuery , I can't just...

Power BI Hierarchy Slicer Display Employee Hierarchy Data

Image
Good evening fellow developers, Here's how to display an employee hierarchy (employees and their supervisor/manager) using the Power BI Hierarchy Slicer custom visual. For this tutorial, I'm using the ContosoRetailDW database which can be downloaded from Microsoft's SQL Server database examples. This SQL Server database already has an Employee table of which an employee is assigned with a parentkey attribute. Next is to create a view that will be used as the Power BI's dataset. This view will has the employee name, employee id, manager name and manager id columns used in generating hierarchical levels in Power BI. Use ContosoRetailDW Go Create View vwEmployeeManager As SELECT [EmployeeKey] as [Employee ID] ,([FirstName] + ' ' + IsNull ([MiddleName], '' ) + ' ' + [LastName]) as [EmployeeName] , IsNull ([ParentEmployeeKey], 18) As [ManagerID] , IsNull (( Select [FirstName] + ' ' + IsNull ([MiddleNa...

Power BI Hierarchy Slicer Last Item Cut Off In Power BI Service

Image
Good evening Gents. I have been using the hierarchy slicer for quite some time and this has helped me solve the grouping mechanism of our reports. Lately, we have found issues such as the slicer is not working on Firefox and today, the last item of the slicer is cut-off/not visible even when you scroll. The issue appears on both Google Chrome and Microsoft Edge browsers. See screenshot below: When I checked on the docs,there's an open issue about the slicer's last item is cut-off if the search box is enabled. Don't know if this issue is related to that. See details here:  https://github.com/liprec/azurebi-docs/issues/124 . Even if I replaced the slicer with the recent version (2.1.4) still the issue appears. Upon doing some experiments, I came up with a solution and presented it to our Software Architect for approval.  Note that this is not the best solution, this is just a temporary workaround. I still recommend for the bug to be fixed and release a version that solves...

Line Chart X-Axis Month Values Not Sorting Correctly In Power BI LineChart

Image
Gents, Today, I had an issue with month values in my line chart visual not sorting correctly. The month values were plainly text in type and it seems the line chart does not recognize it's order. In order for these to work, I need to create a month column to explicitly include the year and retrieve the value using DateValue() function. If the measure is added in the visual, set the proper date format in Power BI desktop for the line chart to recognize the proper sequence. MonthYear = var monthName = TRIM (GrossProfitTrend[MonthName]) Return SWITCH(monthName, "Jan" , DATEVALUE( MONTH ( DATE ( YEAR (NOW()), 1 , 1 )) & " " & YEAR (NOW())) , "Feb" , DATEVALUE( MONTH ( DATE ( YEAR (NOW()), 2 , 1 )) & " " & YEAR (NOW())) , "Mar" , DATEVALUE( MONTH ( DATE ( YEAR (NOW()), 3 , 1 )) & " " & YEAR (NOW())) , "Apr" , DATEVALUE( MONTH ( DATE ( YEAR (NOW()), 4 , 1 )...

Remove Other SQL Or Duplicate DataSources In Power BI Desktop

Image
Good evening fellow developers. I have a Power BI Desktop file that points to two data sources. The two data sources references to one server but different databases. Since I will be using one database for now, I need to remove the other data source. Example datasources from the image are: CebuServer;DatabaseTest1 CebuServer;DatabaseTest2 I need to remove the datasource that points to DatabaseTest2 but there's no option to remove that. So in order to remove the DatabaseTest2 datasource, select that datasource and click Change Source button. The SQL Server database dialog will show up. Simply replace the Database name from DatabaseTest2 (The datasource to be removed) to DatabaseTest1 (the datasource to be retained) then click OK. The redundant or unused datasource will be removed. Cheers!

How To Set Power BI Date Slicer To Current Month

Image
Gents, Here's another simple tip on how to set the date slicer's default value for the current month given that today is the month of March (ex. March 1, 2020 and March 31, 2020). Click the date slicer and go the the Filters on this visual pane. Choose Relative date for Filter Type and is in this month for Show items when the value filter. When you click Apply Filter, the values in the date slicer will now reset to the current month. That's it!

How To Hide Or Show Power BI Visuals In Power BI Desktop

Image
Hi Fellow Programmers! At present I'm working on creating reports for the top management and stakeholders using Power BI. Since I'm done with my training, it's time for the real challenge. The first challenge was familiarizing with the Power BI Desktop on how to hide or show visuals on the report page. After familiarizing with the Power BI Desktop menus, I finally found it. All you need to is to go to the View Menu , then choose Selection in Show Panes . From there you can either hide or show the visual objects. Cheers!

Donate