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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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