DAX

External Article

Using the DAX Calculate and Values Functions

  • Article

In the first two articles in this series on creating DAX formulae, Andy Brown of Wise Owl Training showed how to create calculated columns and measures. In this third article, he turns his attention to two of the most important DAX functions (CALCULATE and VALUES), showing how and when to use them. If DAX knowledge can be compared to a heavily fortified castle, the CALCULATE function is the drawbridge giving access to it.

2019-02-18

2,279 reads

External Article

Creating Measures Using DAX

  • Article

In the first article in this series, Andy Brown demonstrated how to create calculated columns in Power BI using the DAX language. This second article in the series explains what measures are, and how you can use DAX to create measures within Power BI. The formulae in the article apply equally well to PowerPivot and Analysis Services Tabular Model.

2019-01-21

2,447 reads

External Article

Calculating Employee Attrition with DAX – Part 2

  • Article

In part 1, we described the requirements for calculating attrition and also demonstrated one method that doesn’t rely on writing DAX code at all. In the second part of this tip, we introduce alternative methods of creating a calculation in DAX to calculate the number of employees that have left the company.

2018-05-16

2,619 reads

External Article

Calculating Employee Attrition Rate with DAX – Part 1

  • Article

In many businesses, the HR department needs reports on the employee attrition. This is the number of people that leave the company (depending on the reason they leave; the terminology can also be dismissals or turnover). Suppose you have a table with your employee data, where you also store a possible termination date. How do you calculate the number of people who have left the company using the DAX query language?

2018-05-15

2,702 reads

Blogs

Retro Data 2025 – Slidedeck

By

You can find the slides of my session on the €100 DWH in Azure...

The Book of Redgate: We Value Teams

By

This value is something that I still hear today: our best work is done...

Troubleshooting TempDB Log Full Errors When SSMS Won’t Connect

By

Have you ever received the dreaded error from SQL Server that the TempDB log...

Read the latest Blogs

Forums

Is there a way for SP to know who called it?

By water490

Hi everyone I am writing an SP where there is logic inside the SP...

Planning for tomorrow, today - database migrations

By John Martin

Comments posted to this topic are about the item Planning for tomorrow, today -...

Bottlenecks on SQL Server performance

By runarlan

We have a BI-application that connects to input tables on a SQL Server 2022...

Visit the forum

Question of the Day

The Tightly Linked View

I try to run this code on SQL Server 2022. All the objects exist in the database.

CREATE OR ALTER VIEW OrderShipping
AS
SELECT cl.CityNameID,
       cl.CityName,
       o.OrderID,
       o.Customer,
       o.OrderDate,
       o.CustomerID,
       o.cityId
 FROM dbo.CityList AS cl
 INNER JOIN dbo.[Order] AS o ON o.cityId = cl.CityNameID
GO
CREATE OR ALTER FUNCTION GetShipCityForOrder
(
    @OrderID INT
)
RETURNS VARCHAR(50)
WITH SCHEMABINDING
AS
BEGIN
    DECLARE @city VARCHAR(50);
    SELECT @city = os.CityName
    FROM dbo.OrderShipping AS os
    WHERE os.OrderID = @OrderID;
    RETURN @city;
END;
go
What is the result?

See possible answers