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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
TimKroemer
Frequent Visitor

Perform Calculation at a Specific Level of Detail

I have a staff category called Expat - I am trying to control number of expats so have defined a cap as an input to a measure. I then calculate whether, across multiple contracts, the total number of expats in a month exceeds the cap. Expats within Threshold are calculated as "HC (Expat - Capped) = MIN([HC (Expat)],[_UI: Expat Threshold])" and the excess is calculated as "HC (Expat - Excess) = [HC (Expat)]-[HC (Expat - Capped)]" - this gives me the right amounts when I show the information against a monthly timeline but does not allow me to capture the excess in a card (when the calculation is performed at a total level). How can I force the calculation to be performed at a date level? I have tried the following: HC (Expat - Excess) Total = SUMX(Sheet1,MAX(CALCULATE(SUM(Sheet1[Headcount]),FILTER(ALLSELECTED(Sheet1),Sheet1[Date].[Date]=EARLIER(Sheet1[Date].[Date]) && Sheet1[Nationality]="Expat"))-[_UI: Expat Threshold],0)) but it doesnt seem to be working either..

 

Any help would be much appreciated!

 

Gratefully,

 

Tim

1 REPLY 1
Anonymous
Not applicable

@TimKroemer,

It is difficult for us to provide you appropriate DAX based on the above description. Please help to share sample data of your table and post expected result here.

Regards,
Lydia Zhang

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors