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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sachin_kalra
New Member

Filter is not working in Direct query mode

HI Forum

i am using direct query with sql and trying to calculate a value using

TotalBudget = CALCULATE([SumBudget],FILTER(Fact_CE_AM_Revenue,Fact_CE_AM_Revenue[year]=MAX(Fact_CE_AM_Revenue[year])))

but i am facing below error

Function 'FILTER' is not supported in this context in DirectQuery mode.

Note : i have a year column by which budget is differentiated

it will be really helpful if you could help me out

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@sachin_kalra

 

Please enable following option and have a try again.

 

Filter is not working in Direct query mode_1.jpg

 

Best Regards,

Herbert

View solution in original post

8 REPLIES 8
v-haibl-msft
Employee
Employee

@sachin_kalra

 

Please enable following option and have a try again.

 

Filter is not working in Direct query mode_1.jpg

 

Best Regards,

Herbert

This is not a solution. It does not solve the problem.

Enabling below option did not work. Below is our DAX query - 

MTD_Avg_Balance_Debt = TOTALMTD([Sumprin Debt],v_get_TransDate[TransDate])/(DATEDIFF(STARTOFMONTH(v_get_TransDate[TransDate]),max(v_get_TransDate[TransDate]),DAY)+1)

 

Works on desktop version, howver doesnt work once published to sever 

 

Power BI

MdxScript(Model) (23, 54) Function 'DATESMTD' is not supported in DirectQuery mode.
Please try again later or contact support. If you contact support, please provide these details.
Request ID0d017378-356c-923e-4938-8a86f54d5201
TimeFri Mar 16 2018 14:44:39 GMT+0530 (India Standard Time)
Version14.0.600.434

Hi,

Did you find any solution for this??

Please update, even I am facing same issue.

 

Regards,

Gourangi

 

Hi all, this issue is not solved as of May 25, 2018.  We are using Power BI Report Server and the matching version of Power BI Desktop dated March 2018.

 

When we deploy a DirectQuery mode report containing measures like this, with "Allow unrestricted measures in DirectQuery mode" duly enabled

 

LatestCumulativeVarToTarget = 
CALCULATE (
    VALUES ( 'NonAffiliatedOutletSales'[CumulativeVarToTarget] ),
    FILTER (
        'NonAffiliatedOutletSales',
        'NonAffiliatedOutletSales'[CalculateDate]
            = MAX ( 'NonAffiliatedOutletSales'[CalculateDate] )
    )
)

 

and "Save As" to Power BI Report Server, when the report is rendered visuals that use such measures display with the circled X and text "Can't display the visual.  See details."  The details message is:

 

Couldn't load the data for this visual
 
MdxScript(Model) (44, 5) Function 'FILTER' is not supported in this context in DirectQuery mode.
Please try again later or contact support. If you contact support, please provide these details.
Request ID853cc794-8cff-8af9-364f-1d1d6b1a7ec7
TimeFri May 25 2018 08:37:41 GMT-0400 (Eastern Daylight Time)
Version15.0.2.378

 

Not solved.

 

Is this the expected behavior?

I also have the same problem when I used directquery mode. On the other hand, in import mode, this measure is working.

LatestTurbidity = CALCULATE(MAXA(MsgJamhamTest1[Value]), FILTER(MsgJamhamTest1,[Type]="Turbidity"&&[UpdateTime]=MAX([UpdateTime])))
Anonymous
Not applicable

I have a similar issue, i.e. you can get away with unrestricted measures in PBI Desktop only for it to fail on the Reporting Server. Did you find a viable workaround? Can "unrestricted measures" bet set for the Reporting Server as well, and if so how? Any information would be greately appreciated.

 

RE

Enabling below option did not work. Below is our DAX query - 

MTD_Avg_Balance_Debt = TOTALMTD([Sumprin Debt],v_get_TransDate[TransDate])/(DATEDIFF(STARTOFMONTH(v_get_TransDate[TransDate]),max(v_get_TransDate[TransDate]),DAY)+1)

 

Works on desktop version, howver doesnt work once published to sever 

 

Power BI

MdxScript(Model) (23, 54) Function 'DATESMTD' is not supported in DirectQuery mode.
Please try again later or contact support. If you contact support, please provide these details.
Request ID0d017378-356c-923e-4938-8a86f54d5201
TimeFri Mar 16 2018 14:44:39 GMT+0530 (India Standard Time)
Version14.0.600.434

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.