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

View all the Fabric Data Days sessions on demand. View schedule

Reply
M-P
Frequent Visitor

Function 'SUMX' is not allowed as part of calculated column DAX expressions on DirectQuery models

I tried to create a measure to set target based on model as shown below, however I got the error: Function 'SUMX' is not allowed as part of calculated column DAX expressions on DirectQuery models. Any help would be appreciated

 

Target =
SUMX (
    'Table',
    SWITCH (
        TRUE (),
        'Table'[Model] = "A", 10,

        'Table'[Model] = "B", 20,

        'Table'[Model] = "C", 30,

        'Table'[Model] = "D", 40,
        0
    )
)

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @M-P,

 

Have you resolved your problem? If so, would you please mark the helpful reply as an answer or sharing your solution so that it can benefit more users?

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @M-P,

 

All DAX functions are supported for DirectQuery models. However, not all functions are supported for all formula types. Some functions like SUMX are supported in measure and query formulas only. For details: DAX Formula Compatibility in DirectQuery Mode

 

In your scenario, please new a measure rather than creating a calculated column using above formula.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Interkoubess
Solution Sage
Solution Sage

Hi @M-P,

 

Could you please show us a sample ( with your needs) in order to understand your requests.

 

Thank you.

 

 

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