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

Alternative for calculated column in Direct Query

Hi,

is there a way to create a calculated column with Direct Query that gives me the same output as this one?

 

Max Date = CALCULATE( MAX( Table1[DateColumn] ), ALLEXCEPT( Table1, Table1[UserID] ) )

 

 

Regards 

Noah

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @noah44 ;

First of all, in the Directquery mode, the computed column cannot be created, only in import.
Using DirectQuery in Power BI - Power BI | Microsoft Learn

vyalanwumsft_0-1663918468208.png

Second , If the above formula changes to a column, you can use the following two ways

Max Date =
CALCULATE ( MAX ( Table1[DateColumn] ), ALLEXCEPT ( Table1, Table1[UserID] ) )
Max Date =
CALCULATE (
    MAX ( Table1[DateColumn] ),
    FILTER ( Table1, [UserID] = EARLIER ( Table1[UserID] ) )
)

 
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yalanwu-msft,

 

Thank you for your answer!

I understand that the above formula does not Work in Direct Query mode.

So the two ways shown in your post won't work either because of CALCULATE() not being available in DQ-Mode.

 

Is there no alternative way of reaching the same result, within the DQ-Mode restrictions?

Regards
Noah

Hi, @noah44 ;

Because in DQ can't create column,so you could create a measure by dax


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yalanwu-msft 

 

Ok, I think the thing I am trying to achievie is not possible then.
Because even if I do it as a measure, I need to use this measure in another column and that isn't possible either because of DQ restrictions.

 

Thank you anyways

 

Best regards

Noah

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.

Top Solution Authors