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
jkapso751
Helper I
Helper I

DAX formula for allocation ratio denominator

 

Hi all,

I’m trying to create a measure that will calculate the same number for each row in the pivot.  The measure will be used as the denominator for an allocation ratio.  The measure should be sum of CATEGORY1 and CATEGORY2 revenue for each COMPANY CODE.

 

DATA is my fact table that has company codes, accounts, and amounts (among other things).

 

Revenue Measure = CALCULATE(sum(DATA'[Amount]),'DATA'[Account]="Revenue Account Code")

 

Revenue Allocation Key Denominator =

if([Revenue Measure]=0,BLANK(),

CALCULATE(sum('DATA'[Amount]),

ALLEXCEPT('DATA','DATA'[COMPANY CODE]),

'DATA'[Account]="Revenue Account Code",

'DATA'[CATEGORY]="CATEGORY1"||'DATA'[CATEGORY]="CATEGORY2"))

 

Desired output:

jkapso751_1-1686412766058.png

 

The formula above works, but it populates the value for all categories (which is fine, since the numerator is zero for those rows).  I have two questions:

  • Is there a better way to write this formula, perhaps one that makes the “if([Revenue Measure]=0,BLANK()” unnecessary?
  • If I wanted to write this formula so that the amounts are only populated for the CATEGORY1 and CATEGORY2 rows, how could I do that?

 

Many thanks for your help!!!

2 REPLIES 2
tamerj1
Super User
Super User

Hi @jkapso751 

please try

Revenue Allocation Key Denominator =
CALCULATE (
SUM ( 'DATA'[Amount] ),
ALLEXCEPT ( 'DATA', 'DATA'[COMPANY CODE] ),
'DATA'[Account] = "Revenue Account Code",
KEEPFILTERS ( 'DATA'[CATEGORY] IN { "CATEGORY1", "CATEGORY2" } )
)

Thanks tamerj1.  Tried the formula, but the measure is still populating all the rows in the table including the ones with no revenue.

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.