Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi
I succeeded to add a column with a change of date value on a condition =>
= Table.AddColumn(#"Lignes filtrées3", "New Column", each if [fAllDayEvent] = "NON" then [DATE DEBUT] + #duration(0,-7,0,0) else [DATE DEBUT])
I would like to do the same but on the column itself [DATE DEBUT].
How can I do that?
Thanks for your help.
Solved! Go to Solution.
This way should be clearer because we talk about power query =>
#"Query" = Table.ReplaceValue(#"PreviousQuery", each [DATE FIN], each if [fAllDayEvent] = false then [DATE FIN] + #duration(0,-7,0,0) else [DATE FIN], Replacer.ReplaceValue, {"DATE FIN"})
This way should be clearer because we talk about power query =>
#"Query" = Table.ReplaceValue(#"PreviousQuery", each [DATE FIN], each if [fAllDayEvent] = false then [DATE FIN] + #duration(0,-7,0,0) else [DATE FIN], Replacer.ReplaceValue, {"DATE FIN"})
Hello
I found by myself, here is the solution =>
#"Request" = Table.ReplaceValue(#"PreviousRequest", each [DATE FIN], each if [fAllDayEvent] = false then [DATE FIN] + #duration(0,-7,0,0) else [DATE FIN], Replacer.ReplaceValue, {"DATE FIN"})
I found by myself here is the solution =>
= Table.ReplaceValue(#"test", each [DATE DEBUT], each if [fAllDayEvent] = false then [DATE DEBUT] + #duration(0,-7,0,0) else [DATE DEBUT], Replacer.ReplaceValue, {"DATE DEBUT"})
I tried this
NextTableReq= Table.ReplaceValue(#"PreviousTableReq", each if [fAllDayEvent] = "TRUE" then [DATE DEBUT] else false, [DATE DEBUT] + #duration(0,-7,0,0), Replacer.ReplaceValue, {"DATE DEBUT"} )
but I got an error "unknown ID"
We want to help but your description is very conufussing.
Please ask your manager or friends to help you write a clear description with example input data and desired output with a step by step description.
Poor descriptions waste your time and our time,
Here it is, a sample of what I said before;
fAllDayEvent | DATE DEBUT | New Column |
FALSE | 17/11/2023 22:00:00 | 17/11/2023 22:00:00 |
FALSE | 16/11/2023 22:00:00 | 16/11/2023 22:00:00 |
TRUE | 24/11/2023 00:00:00 | 24/11/2023 00:00:00 |
TRUE | 20/11/2023 00:00:00 | 20/11/2023 00:00:00 |
TRUE | 01/11/2023 00:00:00 | 01/11/2023 00:00:00 |
TRUE | 26/12/2023 00:00:00 | 26/12/2023 00:00:00 |
TRUE | 01/01/2024 00:00:00 | 01/01/2024 00:00:00 |
TRUE | 18/12/2023 00:00:00 | 18/12/2023 00:00:00 |
TRUE | 01/11/2023 00:00:00 | 01/11/2023 00:00:00 |
TRUE | 09/11/2023 00:00:00 | 09/11/2023 00:00:00 |
FALSE | 10/11/2023 22:00:00 | 10/11/2023 22:00:00 |
FALSE | 01/12/2023 17:00:00 | 01/12/2023 17:00:00 |
FALSE | 26/12/2023 17:00:00 | 26/12/2023 17:00:00 |
TRUE | 20/11/2023 00:00:00 | 20/11/2023 00:00:00 |
TRUE | 17/11/2023 00:00:00 | 17/11/2023 00:00:00 |
TRUE | 17/11/2023 00:00:00 | 17/11/2023 00:00:00 |
TRUE | 01/12/2023 00:00:00 | 01/12/2023 00:00:00 |
TRUE | 16/11/2023 00:00:00 | 16/11/2023 00:00:00 |
TRUE | 10/11/2023 00:00:00 | 10/11/2023 00:00:00 |
TRUE | 17/11/2023 00:00:00 | 17/11/2023 00:00:00 |
TRUE | 25/12/2023 00:00:00 | 25/12/2023 00:00:00 |
TRUE | 25/12/2023 00:00:00 | 25/12/2023 00:00:00 |
TRUE | 24/11/2023 00:00:00 | 24/11/2023 00:00:00 |
TRUE | 27/12/2023 00:00:00 | 27/12/2023 00:00:00 |
TRUE | 03/11/2023 00:00:00 | 03/11/2023 00:00:00 |
FALSE | 21/12/2023 22:00:00 | 21/12/2023 22:00:00 |
FALSE | 01/12/2023 22:00:00 | 01/12/2023 22:00:00 |
OK I will try to give more informations.
I speak about power query on power bi desktop.
I want to substract 7 hours to a date column [DATE DEBUT] when a condition is respected on an other column [fAllDayEvent].
I succeeded to do that in adding a new column this way =>
New Column = Table.AddColumn(#"Lignes filtrées3", "New Column", each if [fAllDayEvent] = "NO" then [DATE DEBUT] + #duration(0,-7,0,0) else [DATE DEBUT])
But I would prefer doing that on the [DATE DEBUT] column itself without adding any other columns.
Is it possible?
Thanks.
Please provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Also provide the example desired output, with a clear description of the process flow.
Remember not to share private data ... we don't want you to get into trouble.
You will get a quicker and better response if you put time, care and effort into writing clear problem descriptions.
Vaugue descriptions waste your time and ourtime.
We want to help you but your description is too vaugue. Please write it again clearly.
Please DON'T copy & paste your reports that does not work and expect us to fathom what you want to do. That is a bit crazy. 😀
Please just give a simple non technical functional decscription of what you want, then let us suggest the solution. Thank you.
Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Also provide the example desired output, with a clear description of the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.
Vaugue descriptions can waste your time and ourtime.
Look foward to helping you when the above information is forthcoming
fAllDayEvent | DATE DEBUT | New Column |
FALSE | 17/11/2023 22:00:00 | 17/11/2023 22:00:00 |
FALSE | 16/11/2023 22:00:00 | 16/11/2023 22:00:00 |
TRUE | 24/11/2023 00:00:00 | 24/11/2023 00:00:00 |
TRUE | 20/11/2023 00:00:00 | 20/11/2023 00:00:00 |
FALSE | 10/11/2023 22:00:00 | 10/11/2023 22:00:00 |
FALSE | 01/12/2023 17:00:00 | 01/12/2023 17:00:00 |
FALSE | 26/12/2023 17:00:00 | 26/12/2023 17:00:00 |
So If I want to substract 7 hours to a date column [DATE DEBUT] I can do that with adding a NEW COLUMN
this way =>
New Column = Table.AddColumn(#"test", "New Column", each if [fAllDayEvent] = "FALSE" then [DATE DEBUT] + #duration(0,-7,0,0) else [DATE DEBUT])
But I would prefer doing that on the [DATE DEBUT] column itself without adding any other columns.
User | Count |
---|---|
134 | |
68 | |
68 | |
54 | |
52 |
User | Count |
---|---|
207 | |
95 | |
64 | |
61 | |
57 |