Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

SAMEPERIODLASTYEAR on filtered data

Hello,
I have a problem and hope you can help me.
I have developed a dashboard with different metrics for a human resources system. In it some numbers are displayed with their previous year values. There are also different slicers that users can set, including the year, month and status of an employee.
For the previous year values we use the SAMEPERIODLASTYEAR function. This all works quite well so far, but we only want to display the data from last year that was filtered in the current year. E.g.
Employee A has the value 20 in August 2020 and is active at that time. In August 2021 he has no value and is inactive at that time.
In our dashboard, if August 2021 and Active status is selected in the slicers, the employee will still be displayed in the table.

 

EmployeeValueValue previous year
Employee A 

20

Employee B10

15

 

Since the employee is inactive in the current month, he should not appear in the table.

I hope I was able to explain my problem relatively well, I currently do not know if the desired behavior in PowerBi is implementable.

 

Kind regards

Matthias

1 Reply