From the course: SQL Server Analysis Services

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Challenge: USERELATIONSHIP measures

Challenge: USERELATIONSHIP measures - SQL Server Tutorial

From the course: SQL Server Analysis Services

Challenge: USERELATIONSHIP measures

(upbeat music) - [Instructor] For this challenge, we're going to use our inactive relationships by creating a few DAX measures which implement the USERELATIONSHIP function and test them in Excel. We'll be starting in the exercise files, Chapter 5, 05_04b, and then we can open Analysis Services SLN file. The starting point for this challenge is, of course, the ending for our previous challenge. So we're going to be writing a few measures with USERELATIONSHIP, making the inactive relationships actives, and showing the results. For this, we will need to be use the CALCULATE function. The first measure we're going to use is just our control measure, so a simple sum of Fact Sales for total, including tax, which we're going to call Total Sales. Next, we're going to use Total Sales inside our Delivery Sales calculation. So we're going to use the function USERELATIONSHIP to activate the relationship in this DAX measure…

Contents