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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
SzymonKl
Helper I
Helper I

Day Name in DirectQuery

Could you kindly assist me in creating a measure to display the day name based on the 'ORDERS' table and the [ORDER_DATE] column? It's important to consider that we are working with DirectQuery, and thus, the FORMAT function cannot be used.

My approach not working : Day Name = FORMAT('ORDERS'[ORDER_DATE], "dddd") 

 

Thanks

 

 

1 ACCEPTED SOLUTION

Hi Thanks for your support today 🙂 

I was able to find the right solution, instead measure I create a new column : 

Day Name = SWITCH(WEEKDAY('ORDERS'[ORDER_DATE]),
                1, "Sunday",
                2, "Monday",
                3, "Tuesday",
                4, "Wednesday",
                5, "Thursday",
                6, "Friday",
                7, "Saturday",
                BLANK())

View solution in original post

9 REPLIES 9
mlsx4
Memorable Member
Memorable Member

Hi @SzymonKl 

 

Are you using a calendar table? Maybe you can compute the day name there and get it by using the relation?

No , the [ORDER_DATE] column is in 'ORDERS' table and is a Date/Time format.

johnyip
Solution Sage
Solution Sage

@SzymonKl Not sure about this, but does the following work?

 

Day Name(MEASURE) = FORMAT(MAX('ORDERS'[ORDER_DATE]), "dddd") 

 

 

Or it is not working anyway because of DirectQuery?

 



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Thanks for solution unfortunetlly i getting the error :

SzymonKl_0-1689756266072.png

 

Sorry for the typo: it is MAX(

Day Name(MEASURE) = FORMAT(MAX('ORDERS'[ORDER_DATE]), "dddd") 

 



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Thanks 

I see the day name but unfortunately, instead of two records, I get much more. It seems that now the order has been assigned to each Wash Site. Wash Sites are stored in the 'WASH_SITES' table, column [NAME].

Without measure : 

SzymonKl_2-1689758400280.png

 

with measure:

SzymonKl_1-1689758347785.png

 

Please provide some sample fake data that follows the data structure of your actual data, and the relationship between them for checking.



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Hi Thanks for your support today 🙂 

I was able to find the right solution, instead measure I create a new column : 

Day Name = SWITCH(WEEKDAY('ORDERS'[ORDER_DATE]),
                1, "Sunday",
                2, "Monday",
                3, "Tuesday",
                4, "Wednesday",
                5, "Thursday",
                6, "Friday",
                7, "Saturday",
                BLANK())

good to know.



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.