Forum Discussion
Weekly Target
- Anonymous5 years ago
Hi paulfink ,
I suggest operating in Power Query:
Add Day and DateDay column --> Add a conditional column(when the Day=monday or DateDay=1 return the current date) -->Use Fill down .
The full formula in Advanced Editor is as follows:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrLQN7DUNzIwMlDSUQpOLdAFMmJ1gOKW2MWNDbCLGxjqGxrAxP2TS+DiRjjEjXGIm+AQN8UhboZD3ByHuAUOcUvs4kBB7OLY/BsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Period = _t]), #"Changed Type with Locale" = Table.TransformColumnTypes(Source, {{"Date", type date}}, "en-GB"), #"Added Index" = Table.AddIndexColumn(#"Changed Type with Locale", "Index", 1, 1, Int64.Type), #"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each Date.DayOfWeekName([Date])), #"Added Custom1" = Table.AddColumn(#"Added Custom", "DateDay", each Date.Day([Date])), #"Renamed Columns" = Table.RenameColumns(#"Added Custom1",{{"Custom", "Day"}}), #"Added Conditional Column" = Table.AddColumn(#"Renamed Columns", "Custom", each if [Day] = "Monday" then [Date] else if [DateDay] = 1 then [Date] else null), #"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Custom"}) in #"Filled Down"Then add a rank column for conditional formatting:
Column = RANKX ( 'Table', [Custom],, ASC, DENSE )My final visualization looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.Best Regards,
Eyelyn Qin
paulfink , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
- paulfink5 years agoPost Patron
amitchandak i have updated my post