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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
MR
Regular Visitor

Display Data by Week day - ie Mon, Tue etc

Hi 

 

I need to sum multple event hours which happen on a given day of the week during a set time period.

For instance, I want to see the sum of events hours over a month in columns Monday, Tuesday, through to Sunday. This is to see the supply or demand on a given day of the week.

 

How can I sum a these hours by week days?

 

Any ideas?

Matt

1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

Just add a column to your data table, or to your Date table along these lines

 

Weekday = FORMAT(Dates[Date],"DDDD")

And then just drag that column to the axis of your visual.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

Doesn't seem to work for DAX.  "Function 'FORMAT' is not allowed as part of calculated DAX expressions on DirectQuery models."


 

Expression.Error: The name 'FORMAT' wasn't recognized. Make sure it's spelled correctly.

Phil_Seamark
Microsoft Employee
Microsoft Employee

Just add a column to your data table, or to your Date table along these lines

 

Weekday = FORMAT(Dates[Date],"DDDD")

And then just drag that column to the axis of your visual.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Nope. Does not work. I just get this error over and over "Cannot find table 'Dates'."

In my case this did not work. To correct I removed the table reference:

Day of Week Short Name = FORMAT([Date],"DDD")
Output= Mon, Tue, Wed, etc. 

Brilliant! Yet simple

this does not work,  I copied and pasted get too many arguments

Or in Power Query:

 

#"Day of Week" = Table.AddColumn(#"__prior command name__", "__desired new column name__", each Date.DayOfWeekName([__column referencing__], "en-US"), type text)
in
#"Day of Week"

Hi

Is it possible to return short names of weekdays in Power Query?

(In DAX it is possible with FORMAT function)

Anonymous
Not applicable

This also works as part of the addcolumn query when building the Date Table.

For Example: 
Date =
ADDCOLUMNS (
CALENDAR (DATE(2000,1,1), DATE(2025,12,31)),
"Weekday", FORMAT([Date], "DDDD")
)

Excellent, thanks Phil

M

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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