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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Format from DirectQuery

I recently switched from import mode to directquery, but the format function no longer works.

 

Below is the format I used to use in the import mode, that I can get ex: Mon, Tues, Wed, ....

 

Day Name = FORMAT('Date'[By Date], "ddd")
 
I don't want full name of the days, but just the abbreviation.
 
In this case, how to achieve the same goal while in the directquery mode?
 
Thanks in advance.
1 ACCEPTED SOLUTION

hi  @Anonymous 

Since FORMAT Function is not supported in directquery.

You could use SWITCH Function to create a column as below:

Day Name = SWITCH( WEEKDAY('Date'[By Date],2),
1,"Mon",
2,"Tue",
3,"Wed",
4,"Thu",
5,"Fri",
6,"Sat",
7,"Sun")

 

Regards,

Lin

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Columns are not allowed, you can have measure but the display would depend on context

Day Name = FORMAT(max('Date'[By Date]), "ddd")

Anonymous
Not applicable

Thanks. I'd need it in columns, because I want display each date in the column with its day name.

I'll instead achieve this in a SQL query then. In the meanwhile, can PBI add this feature in the DirectQuery mode?

 

Thanks.

hi  @Anonymous 

Since FORMAT Function is not supported in directquery.

You could use SWITCH Function to create a column as below:

Day Name = SWITCH( WEEKDAY('Date'[By Date],2),
1,"Mon",
2,"Tue",
3,"Wed",
4,"Thu",
5,"Fri",
6,"Sat",
7,"Sun")

 

Regards,

Lin

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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