Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
olciasandra
New Member

selected value -1 - custom periods headcount

Hi, 

 

Could you please help me with the below? 

 

I have a list of employees IDs for the last two years.  Next to that I have a custom period that we are using instead of months. I've added an index column matching the custom periods from the beginning until the end of our "custom calendar". 

 

I am trying to find a way that the customer will filter the report eg. 2018p9 and he or she will get the headcount difference 2018p9-2018p8.

 

I've added three measures:

Current Period = calculate(DISTINCTCOUNT('DATA BASE'[Employee ID]),FILTER(('DATA BASE'),'DATA BASE'[Index - YP]=SELECTEDVALUE('DATA BASE'[Index - YP])))
 
Prev.YP = CALCULATE(SELECTEDVALUE('DATA BASE'[Index - YP])-1)   
 
Previous period = calculate(DISTINCTCOUNT('DATA BASE'[Employee ID]),FILTER('DATA BASE',[Prev.YP]))
 

 It seems that previous period headcount is not counting properly, so the differenct between two periods is not correct. 

Could you please help?

 

Below the table with example. 

 

Employee IDCustom period

Index-YP

[index column]

1232018p11
1232018p22
4562018p33
7892018p44
2342018p55
1232018p66
...2018p77
..2018p88
...2018p99
..2018p1010
..2018p1111
..2018p1212
..2018p1313
 2019p114
 2019p215
 2019p316
 2019p417
 2019p518
0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.