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
Anonymous
Not applicable

display selected month trick not working on directquery mode

Used the calculated measure below to display current selected month in a card. Worked under import mode. But not under direct query mode. Can anyone confirm and suggest a workaround?

 

SelectedMonthText = if(HASONEVALUE('Date'[CalendarYearMonth]), "Selected Month " & format(FIRSTNONBLANK('Date'[CalendarYearMonth], TRUE), "MMM YYYY"), "")

2 REPLIES 2
v-sihou-msft
Employee
Employee

@Anonymous

 

Hi pbuser,

 

In Direct Query mode, to ensure that queries sent to the underlying data source have acceptable performance, limitations are imposed on measures by default.

 

Both FORMAT and FIRSTNONBLANK Function are not supported for use in DirectQuery mode by default. Please see: https://msdn.microsoft.com/library/mt723603(SQL.130).aspx.

 

Advanced users can choose to bypass this limitation by selecting File > Options and then Settings > Options > DirectQuery, then selecting the option *Allow unrestricted measures in DirectQuery mode*. When that option is selected, any DAX expression that is valid for a measure can be used. Users must be aware, however, that some expressions that perform very well when the data is imported may result in very slow queries to the backend source when in DirectQuery mode.

 

Regards,

The performance is too slow after enabling the above settings. Any clues?

Praveen Kumar G
Inatech

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.