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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.