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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Calculated Column Measure Error

Hi Experts

 

Getting the following error message when using calculate column measre with DirectQuery.....is there a work around

Capture.PNG

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Try like following ,if not work ,could you pls share your pbix file?Remember to remove confidential data.

 MDX:

AOV.=
CALCULATE (
    SUM ( factsalesordertable[Gross_Order_value] ),
    FILTER (
        ALL ( 'factsalesordertable' ),
        'factsalesordertable'[Gross_Order_Value]
            = MAX ( 'factsalesordertable'[Gross_Order_Value] )
    )
)

If use sql ,adjust accord the following SQL:(Remember to backup base data table)

Step 1,

Create table table1 as  select T.*,SUM(T.Gross_Order_Value)  from   FACTSalesOrdertable T  group by t.*.

 Step 2,

drop table1 purge.

Step 3,

alter table table1 rename table.

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Try like following ,if not work ,could you pls share your pbix file?Remember to remove confidential data.

 MDX:

AOV.=
CALCULATE (
    SUM ( factsalesordertable[Gross_Order_value] ),
    FILTER (
        ALL ( 'factsalesordertable' ),
        'factsalesordertable'[Gross_Order_Value]
            = MAX ( 'factsalesordertable'[Gross_Order_Value] )
    )
)

If use sql ,adjust accord the following SQL:(Remember to backup base data table)

Step 1,

Create table table1 as  select T.*,SUM(T.Gross_Order_Value)  from   FACTSalesOrdertable T  group by t.*.

 Step 2,

drop table1 purge.

Step 3,

alter table table1 rename table.

 

Wish it is helpful for you!

 

Best Regards

Lucien

Pragati11
Super User
Super User

HI @Anonymous ,

 

There are certain limitations of using Directquery mode in Power BI. One of them is creating calculated columns.

If you want to create a column do it in the source not in Power BI as this is a limitation with DirectQuery mode or you can see if a measure will work for your scenario.

 

For details check here:

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery

Pragati11_0-1624649482315.png

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi - How would i write this as SQL and or MDX.....totally stuck. Please

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.