Posts

Donate

Power BI : Count Rows Using RowCount Not Working

I have this DAX formula that counts the number of rows using Calculate() function with [RowCount] as the expression and a certain condition as the filter. CountARCurrent = CALCULATE([RowCount], AccountsReceivablesAging[ Current ] > 0 ) This works on most of the report's dataset however when I tried importing a new dataset, the formula above didn't work. The data used in the filter is a floating point number and the datasets involved in this project are imported via Direct Query. After searching the Power BI forums, I found an alternative solution which is to use COUNTROWS() function instead of [RowCount] as the expression. CountARCurrent = CALCULATE(COUNTROWS(AccountsReceivablesAging), AccountsReceivablesAging[ Current ] > 0 )

Rounding Off Floating Point Numbers To Integer Using DAX In Power BI

Hi, Just sharing a simple DAX formula to round off floating point numbers to int. AvgDayToPayRnd = Int (ROUND(AccountsReceivablesAging[AvgDayToPay], 0 )) First, you have to use the Round() function passing in the table column as the first parameter and 0 which means no trailing zeroes in the second parameter. Then cast that number to an integer type using the Int() function. Cheers!

How To Check If SQL Server Column Is Null Or Empty

Hello fellow programmers! Here's a simple T-SQL statement that will check if a column value is null or empty. IIF( c .BillPhone is null , '' , IIF(Len( c .BillPhone) > 0, c .BillPhone , '' )) as BillingPhone First, it will check if the field is null. If true, it will return empty string. Else, another checking will be performed and this time if it's an empty string. If not an empty string, show the column value. Else show an empty string. That's it! :-)

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!

BACKUP LOG cannot be performed because there is no current database backup In SQL Server

Image
Hi All, While restoring a new database backup which resides from the server in US, I encountered an error which is 'SQL Server error 4214 - BACKUP LOG cannot be performed because there is no current database backup' . Glad that I had a skype session with our software architect in the US and presented to him the issue. The solution that worked was when performing the restore of the backup database was to go to the Options of Restore Database dialog and uncheck these two checkboxes 'Take tail-log backup before restore checkbox' and 'Leave source database in the restoring state checkbox' . Then check 'Check Overwrite the existing database (WITH REPLACE)' box. After that, the restore operation succeeded.

How To Change Open And Closed Folder Icons Of jsTree

To change the open and close folder icons, I found the answer here which is to set the 'open' and 'closed' properties of 'types' plugin. On the 'open_node' and 'close_node' events of the tree, set the data.nodes to 'open' and 'closed' respectively. See sample code below. function InitTreeEmployeesList() { $( '#jstree' ).jstree({ 'core' : { 'multiple' : false , 'themes' : { 'dots' : true , 'icons' : true } }, 'types' : { 'default' : { 'icon' : '../Content/Employee/Images/emp_default.png' }, 'open' : { 'icon' : '../Content/Employee/Images/employee_active.png' }, 'closed' : { 'icon' : '../Content/Employee/Images/emp_default.png' } },...

Bootstrap Table Uncheck The Checkboxes On Page Load

Good evening all! When working with checkboxes in Bootstrap Table created by Wenzhixin, you may have notice that on page load the checkboxes are checked by default. If you want to uncheck these checkboxes on page load of your ASP.NET MVC page, call the checkInvert method of the bootstrap table on document ready of the page such as the code below: $(document).ready( function () { UncheckShoppingCartTable(); }); function UncheckShoppingCartTable() { $( '#tblShoppingCart' ).bootstrapTable( 'checkInvert' ); }

Custom AuthorizeAttribute Class In ASP.NET MVC

Hello All! In ASP.NET MVC projects, you would normally handle Unauthorized users if they access to a page in which they don't have access to. To do this I have a custom class that inherits the AuthorizeAttribute class. This class was take from accepted answers in stackoverflow with some modifications according to my needs for the project. Here's the complete AuthorizeUser class. using System.Configuration; using System.Web.Mvc; namespace AuthenticationDemo { public class AuthorizeUsersAttribute : AuthorizeAttribute { private string redirectUrl = "" ; public string NotifyUrl { get { return redirectUrl; } set { redirectUrl = value ; } } public AuthorizeUsersAttribute() : base () { } public AuthorizeUsersAttribute( string redirectUrl) : base () { this .redirectUrl = redirectUrl; } protected ov...

How To Debug Or Step Through A WCF Service In ASP.NET MVC Application

Hello, In order to step through the WCF project in debugging mode through and ASP.NET MVC, follow these simple steps. WCF Project 1. Right click on the Solution of the WCF Service Project 2. Choose Properties 3. On Startup Project -> Select Multiple startup projects 4. On the Action dropdown of the WCF Service project, choose "Start". ASP.NET MVC Project 1. Run the WCF Service Project using the default web browser 2. Add a WCF connection using Connected Services (Make sure to type the correct url of the service). See web.config value below. 3. In web.config, add an endpoint element for the WCF service. <endpoint address= "http://localhost:63070/Service.svc" binding= "basicHttpBinding" bindingConfiguration= "BasicHttpBinding_Service1" contract= "DataLocalHostService.DataService" name= "BasicHttpBinding_Service1" /> 4. In your controller, you may call the service based from...

Donate