Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All ,
I need some inputs regarding adding a new field "Status" . I have start date and End Date .
The logic Is , if current date is between startdate and End date then the status is "Active" else "Inactive"
Im using this
= Table.AddColumn(tablename, "Status", each if [Start_Date] <= Date.From(DateTime.LocalNow()) then "Active" else if [End_Date] >= Date.From(DateTime.LocalNow()) then "Active" else "Inactive")
TIA!
Solved! Go to Solution.
Sorry, I have updated the script to use your table name.
Table.AddColumn(tablename, "Status", each let today = Date.From ( DateTime.FixedLocalNow() ) in if [Start_Date] <= today and [End_Date] >= today then "Active" else "Inactive", type text)
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Sorry, I have updated the script to use your table name.
Table.AddColumn(tablename, "Status", each let today = Date.From ( DateTime.FixedLocalNow() ) in if [Start_Date] <= today and [End_Date] >= today then "Active" else "Inactive", type text)
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Hello! Here you go:
Table.AddColumn(#"Changed Type", "Status", each let today = Date.From ( DateTime.FixedLocalNow() ) in if [StartDate] <= today and [EndDate] >= today then "Active" else "Inactive", type text)
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
@jennratten Thanks for replying . Im getting this
"The name 'Changed Type' wasn't recognized. Make sure it's spelled correctly."
Im new to powerQuery . Any idea what im missing ?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |