Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello
I have this table :
Can I ask you for a function that puts me where the empty values are on the last day of that week?
I would like to have the results of the 2 dates:
date in 22/03/2022 date out 27/03/2022
date in 16/03/2022 date out 20/03/2022
PS: I have the data for a whole year
Solved! Go to Solution.
The solution in power query is :
if [date out]=null then Date.EndOfWeek ([date in ],Day.Sunday) else [date out])
🤣
The solution in power query is :
if [date out]=null then Date.EndOfWeek ([date in ],Day.Sunday) else [date out])
🤣
Hi @Cocrodile ,
I'm not sure I get the joke here.
The code you've provided and marked as the solution doesn't actually give you the dates that you asked for. I think your code should be:
if [date out] = null then Date.EndOfWeek([date in], Day.Monday) else [date out]
Pete
Proud to be a Datanaut!
we in europe consider the weekend to be Sunday ..
however, I laughed because the solution was very easy
Hi,
You can try:
- add a custom column to your date table
- then a calculated column
If this post is useful to help you to solve your issue consider giving the post a thumbs up
and accepting it as a solution !
Hi @Cocrodile ,
You can use an edited replace step like this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLRNzDWNzIwMlLSUTIyg3NidYByRkhyYBFDZNWGliiqDc1QVMcCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"data in" = _t, #"data out" = _t]),
chgTypes = Table.TransformColumnTypes(Source,{{"data in", type date}, {"data out", type date}}),
repNulls = Table.ReplaceValue(chgTypes,null, each Date.EndOfWeek([data in], Day.Monday),Replacer.ReplaceValue,{"data out"})
in
repNulls
To get this:
Pete
Proud to be a Datanaut!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |