Posts

Donate

Function Format In DAX Not Allowed In DirectQuery Calculated Columns When Formatting Dates

Good evening fellow developers, I have a scenario wherein I will set the default value of a slicer to the current month by default. A link in the forums presented the solution below. Current Month = IF( MONTH ( 'Transactions' [transdate]) = Month (NOW()) && YEAR ( 'Transactions' [transdate]) = YEAR (NOW()), "Current Month" , Format( 'Transactions' [transdate], "YYYY mmmm" )) Since, I'm using DirectQuery connection, the Format() function isn't allowed in calculated columns. After doing some tweaking on my column, the fix that I've come up with was to extract the month and year individually and concatenate them and return that value to the Current Month column. Current Month = IF( MONTH ( 'Transactions' [transdate]) = Month (NOW()) && YEAR ( 'Transactions' [transdate]) = YEAR (NOW()), "Current Month" , Year ( 'Transactions' [transdate]) & "/" & Month...

Power BI Nested Filter Function Alternative In DAX

Image
Hello Team, I've started learning grasping the concepts of DAX through videos and blog posts using DAX Studio since most of the tasks I'm currently working are Power BI reports. I also want to experiment on how can I simplify or modify the formula using other functions so as to make it easier to understand. One example is a nested Filter() formula below. EVALUATE FILTER ( FILTER ( Products, Products[UnitPrice] > 50 ), Products[UnitsInStock] > 10 ) The first parameter of the outer FILTER() function is another filter which returns a table Products with UnitPrice of greater than 50. Then the second parameter filters the table returned by removing Products whose UnitInStock is less than or equal to 10. Upon recognizing the formula, I can simplify that to use AND() function and pass those two filter conditions in the function. The simplified formula, returns same results. EVALUATE FILTER ( Products, AND ( Products[UnitPrice] > 50 , Products[UnitsInStock]...

Power BI: DM_GWPipeline_Gateway_SpooledOperationMissing Error On Premises Data Gateway

Image
Hello Team, After configuring dataset refresh of our reports, we've been receiving this error called "DM_GWPipeline_Gateway_SpooledOperationMissing" for a month now and we have done a lot of research and possible solutions based from the forums and technical blogs. But none of them worked. Few weeks later, I just learned from our Lead Architect that the Virtual Machine of where the data gateway is setup was cloned. Due to the machine being cloned, both machines must have run the data gateway. So uninstalling the data gateway from the cloned machine solves the issue. Cheers

Format Negative Numbers In DAX Using Parenthesis Instead Of Negative Sign In Power BI

Here's a simple DAX formula that I learned from the forums on how to show the negative numbers into the Matrix Visual without negative sign but enclosed in parenthesis. Month Sales Formatted = FORMAT([ Month Sales Measure], "#,##0;(#,##0)" ) Cheers!

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!

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!

Donate