Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I am getting this error in direct query with the following formula. I have tried both column and measure with the same issue. It works fine if using a import template opposed to directquery.
Defined_Date =
IF (
TIMEVALUE ( works_order[Time] ) >= TIMEVALUE ( "07:00:00" )
&& TIMEVALUE ( works_order[Time] ) <= TIMEVALUE ( "23:59:59" ),
works_order[wo_built_datetime].[Date],
IF (
TIMEVALUE ( works_order[Time] ) < TIMEVALUE ( "07:00:00" )
&& CONTAINS (
works_order,
works_order[wo_built_datetime].[Date], works_order[wo_built_datetime].[Date] - 1
),
works_order[wo_built_datetime].[Date] - 1,
works_order[wo_built_datetime].[Date]
)
)
Not sure why this would be?
Hi @CraigBlackman,
Since there are some of limitions to use dax at directquery mode, you can use power query to check the value.
Below is the sample.
Table.
Formula:
#"Added Custom1" = Table.AddColumn(#"Changed Type", "Custom", each if Time.From([USDate]) >= #time(7,0,0) and Time.From([USDate]) <= #time(23,59,59) then [USDate] else if Time.From([USDate]) < #time(7,0,0) and List.Contains(Table.SelectColumns(Table.TransformColumnTypes(#"Changed Type",{{"USDate", type date}}),"USDate")[USDate],Date.AddDays(Date.From([USDate]), -1)) then Date.AddDays(Date.From([USDate]), -1) else [USDate])
Result:
Regards,
Xiaoxin Sheng