Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi every one,
I have a report showing 3 days operation, yesterday, Today, and tomorrow, but the on Sunday the bigging of the week I need this report to show Thursday, Friday, and Saturday, and this is only on sunday
Can someone advise how to do this??
this what I have done so far:
if [Oper.Date UTC] = DateTime.Date(DateTime.LocalNow()) then "Today"
else if [Oper.Date UTC] = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-1)) then "Yesterday"
else if [Oper.Date UTC] = DateTime.Date(Date.AddDays(DateTime.LocalNow(),+1)) then "Tomorrow"
else if [Oper.Date UTC] = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-2)) and [Oper.Date UTC] = Day.Sunday then "Friday"
else if [Oper.Date UTC] = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-3)) and [Oper.Date UTC] = Day.Sunday then "Thursday"
else null
Solved! Go to Solution.
Use this
= if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))="Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-1)) then "Saturday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))="Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-2)) then "Friday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))="Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-3)) then "Thursday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))<>"Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(DateTime.LocalNow()) then "Today" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))<>"Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-1)) then "Yesterday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))<>"Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),+1)) then "Tomorrow" else
null
Use this
= if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))="Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-1)) then "Saturday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))="Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-2)) then "Friday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))="Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-3)) then "Thursday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))<>"Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(DateTime.LocalNow()) then "Today" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))<>"Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),-1)) then "Yesterday" else
if Date.DayOfWeekName(DateTime.Date(DateTime.FixedLocalNow()))<>"Sunday" and Date.From([Oper.Date UTC]) = DateTime.Date(Date.AddDays(DateTime.LocalNow(),+1)) then "Tomorrow" else
null
Thanks for your help
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
68 | |
64 | |
27 | |
18 | |
13 |