Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
secreenshotHello,
Can anyone help me to display the name of the days instead of the dates in line graph
Hello,
I've tried what you've said. I don't know where I am stuck at. I'm still dumb in Power bi.
There are half-hourly data listed on the excel file. But, I want my data to be drawn with week names. Like Monday instead of 2 March.
Looking forward to hearing from you.
The best way to do what you are looking for (and for better analysis in general) is to unpivot your data. I put your example data in and came up with the query below to transform your data and generate the Day of Week Name you are looking for. There is also a Day of Week Number column to be used as a "Sort By Column" so your day names appear in the correct order in your visuals.
Create a new blank query, go to Advanced Editor, and replace the text there with the M code below. Once you load this table you can use the Hour and Day of Week Name columns as rows/columns in a matrix or other visuals, and use a simple DAX measure like SUM(Table[Value]) to sum up your number column.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VZLLEcMwCER78TkH/p+0kkn/bURiNRP7xCDz2AX8+VxKnX69LulW3bE8aaJR7+jNtiJnCa9I9FZ6E13f14LZNNajksbAzSQDF+93ycyBS3m/Ey/yBrsMzG0nogn1wEVxYDXAf2XpmI7STrCtmVD0ybPdx3b3jiR3ZSqZmSurMOsUS9aB3XTg7AKsdzhgLxSLEmNABZgcC7PcOelD2WeLa7YUQAlYHPbpjEFYmD6URVHMhiJVwYmwda+xy542sD2UY+xIeIztDMd9SxuLiz53NsCPmRlwz2zL/lkUC/I470a7OfldWRizrY9T1ELYvknj50EzTnXAN2VNqymi3rMrM07VMSdUWX/NztVHhOKunDa2VCOniRUhl5ldtWTuH6wHPsrfHw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"02 March" = _t, #"09 March" = _t, #"16 March" = _t, #"23 March" = _t, #"30 March" = _t, #"6 April" = _t, hour = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"02 March", type text}, {"09 March", Int64.Type}, {"16 March", Int64.Type}, {"23 March", Int64.Type}, {"30 March", Int64.Type}, {"6 April", Int64.Type}, {"hour", type time}}),
#"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"hour", "02 March", "09 March", "16 March", "23 March", "30 March", "6 April"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Reordered Columns", {"hour"}, "Attribute", "Value"),
#"Changed Type1" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Value", Int64.Type}, {"Attribute", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Attribute", "Date"}}),
#"Inserted Day Name" = Table.AddColumn(#"Renamed Columns", "Day Name", each Date.DayOfWeekName([Date]), type text),
#"Added Custom" = Table.AddColumn(#"Inserted Day Name", "DayNumberForSorting", each Date.DayOfWeek([Date])),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Custom",{{"DayNumberForSorting", Int64.Type}})
in
#"Changed Type2"
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hello,
I have tried what you have said but It was not possible for me to do it. Finally, I have just created the columns where the name and the number of weeks are listed. However, When plotted, the sort of days are not proper and the graph has plotted completely something different. It should not be hard as it seems to be but it is taking my hours just to show the name of the days instead of numbers.
I look forward to hearing from you
Add a column to your table with the Date column with this expression and use that in your visual. You will likely need to add a WEEKDAY() column too to use in a Sort By Column for your day name column.
DayOfWeek = FORMAT(Table[Date], "dddd")
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |