Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have a calculated column that takes a date range and groups it into its own financial period.
Switch(
True(),
Test[date] >= date(2017,10,1) && test[date] <= date(2018, 04, 6), "17/18",
Test[date] >= date(2018,10,1) && test[date] <= date(2019, 04, 6), "18/19", blank()
)
Does anyone know how to recreate this logic in Power Query please using the Add Column?
Solved! Go to Solution.
Hy @M_SBS_6
Yes, You can do it by using this code.
if [Date] >= #date(2017, 10, 1) and [Date] <= #date(2018, 4, 6) then "17/18"
else if [Date] >= #date(2018, 10, 1) and [Date] <= #date(2019, 4, 6) then "18/19"
else null
Best Regards,
Muhammad Yousaf
If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
Hy @M_SBS_6
Yes, You can do it by using this code.
if [Date] >= #date(2017, 10, 1) and [Date] <= #date(2018, 4, 6) then "17/18"
else if [Date] >= #date(2018, 10, 1) and [Date] <= #date(2019, 4, 6) then "18/19"
else null
Best Regards,
Muhammad Yousaf
If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
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 |
---|---|
112 | |
93 | |
90 | |
35 | |
35 |
User | Count |
---|---|
154 | |
102 | |
82 | |
64 | |
54 |