Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Getting day name using calender table created using Dax

I created small Calender table using below. 

Calendar = CALENDAR(DATE(2021,5,1),DATE(2021,05,14))
 
Then created a new measure for day name of the week using below ;
Day of Week Name = FORMAT('Calendar'[Date],"dddd")
 
I have another data source with 'date' column .(source - Daily Click Data
 
Now simply i want to draw a bar grapg indicating the counts from daily click data source for different days names of the week (as in sunday how many counts , monday how mant , etc? ) 
But how can I join my calender table with the 'Daily Click Data ' source and draw this graph ?
 
  • Anonymous 

    You should add as a new column not a measure to your calendar table: 

    Create a new column in your column in your calendar table with 

    Day of Week Name = FORMAT('Calendar'[Date],"dddd")

    Then, create a relationship between the Calendar[Date] and Daily Click Data table

     

     

3 Replies

  • Anonymous 

    You should add as a new column not a measure to your calendar table: 

    Create a new column in your column in your calendar table with 

    Day of Week Name = FORMAT('Calendar'[Date],"dddd")

    Then, create a relationship between the Calendar[Date] and Daily Click Data table

     

     

  • Hey guys,

     

    There is an easier way to do this, and Power bi will still recognize it as a date! (It will sort monday to friday instead of alphabetical.)

    Create a new column

    Day of Week Name = [Date]

    [Date] is whatever the column name is of the date you want abbreviated.

    In column tools, First make sure the Data type of the new column is date, then  with the new column selected, type ddd into the format box. (It won't suggest it but you can still type it manually.) hit enter and boom there it is.......

    You can type out any date format you want. from here:  https://learn.microsoft.com/en-us/dax/format-function-dax#custom-datetime-formats

    I just stumbled across this on accident. I have never seen anyone else suggest this method on any forums.

    Hopefully this helps .

     

    SlimShady

  • Mohammad_Refaei's avatar
    Mohammad_Refaei
    Solution Specialist

    Day Of Week Name could be added as a column to your Calendar table which I assume has a relathionship to source - Daily Click Data table. In your chart use the day name from the Calendar table and aggregate the click values from the daily click data table.