Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I need custome column in PQ, where I have already "Date" column.
If month is 2 (Feb.) to 11 (Nov.), result is the 1st day of previous month, same year, .
If monthe is 1 (Jan.), result is the 1st day, of month 12 (Dec.), last year.
Please help with the correct "if" query
Solved! Go to Solution.
Hi @RafaelAri ,
You can add a custom column and try this ,
if Date.Month([Date]) = 1 then #date(Date.Year([Date])-1, 12, 1) else #date(Date.Year([Date]), Date.Month([Date])-1, 1))
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi @RafaelAri
You can try
Date.From(Date.StartOfMonth(Date.AddMonths([Date], -1)))
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Hi @RafaelAri ,
You can add a custom column and try this ,
if Date.Month([Date]) = 1 then #date(Date.Year([Date])-1, 12, 1) else #date(Date.Year([Date]), Date.Month([Date])-1, 1))
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
101 | |
87 | |
35 | |
35 |
User | Count |
---|---|
152 | |
100 | |
83 | |
63 | |
54 |