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
Haleem
Helper III
Helper III

SUM headcount by Fiscal Period (non-cumulative)

 

I would like to create a measure which SUM headcount column based on user selecting "Fiscal Period" on the Slicer as shown below. When user select P1 and P2, the headcount gets double if i use normal SUM function, as shown below. How can I get the Expected results i.e. The sum should be based on the latest period selected in the slicer i.e. ONLY P2 in the below example, although user has selected P1 and P2. 

 

SUM headcount based on Slicer.png

1 ACCEPTED SOLUTION
Kristjan76
Responsive Resident
Responsive Resident

Hi Haleem,

I would try something like this:

SUM headcount =
VAR lastPeriod = MAX(Table[Fiscal Period])
RETURN
CALCULATE(SUM(Table[Headcount]),Table[Fisical Period] = lastPeriod)

This should work if you have Fiscal Period as numberic value and latest period with highest value. If you do not have a such column, you can just add it as calculated column.

 

 

Regards,

kristjan76

View solution in original post

1 REPLY 1
Kristjan76
Responsive Resident
Responsive Resident

Hi Haleem,

I would try something like this:

SUM headcount =
VAR lastPeriod = MAX(Table[Fiscal Period])
RETURN
CALCULATE(SUM(Table[Headcount]),Table[Fisical Period] = lastPeriod)

This should work if you have Fiscal Period as numberic value and latest period with highest value. If you do not have a such column, you can just add it as calculated column.

 

 

Regards,

kristjan76

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.