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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Top Kudoed Authors