Saturday, April 29, 2017

CASE WHEN with between function in DAX


I used this nested IF function to create a new column based on the Sum Rain mm column.

Column = IF('Weather daily'[Sum Rain mm]<=3,"Dry" ,IF('Weather daily'[Sum Rain mm] > 3 && 'Weather daily'[Sum Rain mm] <= 1,"Rainy Day",IF('Weather daily'[Sum Rain mm]> 10 && 'Weather daily'[Sum Rain mm] <= 50,"Wet Day", IF('Weather daily'[Sum Rain mm] >= 50,"Heavy Rain") )))

Monday, April 24, 2017

Deleting Rows Based on a Table Lookup or CTE

There will be times when you’ll want to delete rows from a table based on data in another table. For example, suppose you want to delete rows from the SalesStaff table for only those salespeople who had no sales in the preceding year. However, the SalesStaff table does not contain this information, but the vSalesPerson view does.

DELETE SalesStaff
WHERE StaffID IN
  (
    SELECT BusinessEntityID
    FROM Sales.vSalesPerson
    WHERE SalesLastYear = 0
  );

Saturday, April 22, 2017

PowerBI Tips and Tricks Video Gallery

PowerBI Tips and Tricks Video Gallery


The Video Gallery is a place for community rockstars like you to share your knowledge and provide tips and tricks for all things related to Power BI, including data analysis and modelling, custom visual development, using DAX, and more. Most videos in the Gallery are designed to be short and easy to watch at work or while on the go on your mobile device.

Wednesday, April 5, 2017

CASE WHEN in PowerQuery

This way you can get a SQL CASE expression in Power Query.



PowerPivot for Excel is in the middle of an action that blocks interaction with Data Models.



When this event occurs there is often only one solution. Save your work, start task manager, kill the Excel.exe process. Restart Excel, everything works properly again.

Thursday, March 2, 2017

SSRS Report Data toolbox is missing in VS (Visual Studio)

Sometimes it happens that the Report Data toolbox is missing in Visual Studio, like this:


In this case you can do 2 things:

1) Press Control - Alt - D

2) Go to View - Report Data 


Tuesday, February 28, 2017

Insert multiple rows using a single SQL INSERT statement


How to insert multiple rows using a single SQL INSERT statement.

INSERT INTO MyTable ( Column1, Column2 ) VALUES
( Value1, Value2 ), ( Value1, Value2 )

Example of updating SQL table with join's and subselect