Warm tip: This article is reproduced from stackoverflow.com, please click
dax ssas ssas-tabular

DAX: Classifying employees based on outcome of measure

发布于 2020-04-22 10:17:17

I'm trying to classify employees by how many times they've called in sick in a given time period. I already have a measure which calculates the number of times an employee calls in sick in a given context. Below is a rough sketch of what I want the result to look like:

Rough sketch of desired result

The data set I have has the date of calling in sick as well as the date the employee started working again (given that they have recovered already) for each date that the given employee is employed (so it also shows days that an employee is not sick) example below.

Example of data set

So for the above example I want employee 1 to be classified as "2" if I look at this entire year, however if I drill down to the months I want employee 1 to be classified as "1" in both january and february.

Does anyone know if and how this can be done?

I'm using Visual Studio 2017 SSAS Tabular.

Please tell me if something is not clear :).

Questioner
Stinna
Viewed
23
Stinna 2020-02-19 20:18

I figured out how to do it with the link posted below:

https://www.daxpatterns.com/dynamic-segmentation/