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
Brycert
Resolver I
Resolver I

Getting additional attributes from TOPN measure returns dreaded "Exceeded resources error"

Greetings all,

 

I have a very simple model:

 

Brycert_0-1632505964438.png

 

 

What I am wanting to do is calculate Claims Count of Claims Paid (a measure) against the TOP 10 NDCs that are in the DrugInformation table as well as the Claim table (1 To many from Claims to Druginformation). So this measure:

 

Top 10 NDC Claim Count Paid = var ranking = VALUES(DrugInformation[NDC]) return CALCULATE(Claim_Measures[Count of Claims Paid], TOPN(10,ALLSELECTED(DrugInformation[NDC]),Claim_Measures[Count of Claims Paid], DESC), ranking)
 
seems to work fine, I can add The ChainName, as well as the NDC from the Druginformation table like this:
 
Brycert_1-1632506160373.png

 

 However, when I add an additional attribute (Drugname) coming from the DrugInformation table, I get an error that the available resources have been exceeeded. What am I doing wrong? NDC is the primary key in DrugInformation, so I would expect that adding a nonkey attribute would be no issue. 
1 ACCEPTED SOLUTION
Brycert
Resolver I
Resolver I

I found the issue, the values clause should contain the whole table in the Calculate function:

 

Top 10 NDC Claim Count Paid = var ranking = VALUES(DrugInformation[NDC]) return CALCULATE(Claim_Measures[Count of Claims Paid], TOPN(10,ALL(DrugInformation),Claim_Measures[Count of Claims Paid], DESC), ranking)

View solution in original post

2 REPLIES 2
Brycert
Resolver I
Resolver I

I found the issue, the values clause should contain the whole table in the Calculate function:

 

Top 10 NDC Claim Count Paid = var ranking = VALUES(DrugInformation[NDC]) return CALCULATE(Claim_Measures[Count of Claims Paid], TOPN(10,ALL(DrugInformation),Claim_Measures[Count of Claims Paid], DESC), ranking)

Brycert
Resolver I
Resolver I

Let me also add that these "Drug Names" are not unique in the Drug Information table. But I wouldnt expect that to be an issue as the NDC corresponds to that exact Drug Name. Just an FYI however.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.