Forum Discussion

MR's avatar
MR
Regular Visitor
9 years ago
Solved

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

  • 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.

11 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Icon for Microsoft Employee rankMicrosoft 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.

    • MR's avatar
      MR
      Regular Visitor

      Excellent, thanks Phil

      M

    • CGodfrey's avatar
      CGodfrey
      Frequent Visitor

      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. 

    • Anonymous's avatar
      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")
      )

  • Anonymous's avatar
    Anonymous
    Not applicable

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


     

    • akayuche's avatar
      akayuche
      New Member

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