cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Conditional columns

I have a report im working on and the user wants me to add a contional column that places OVERDUE for any date that isnt the current date.  I was able to create the coulmn, but I was only able to enter a single date.  How can I tell it to change daily so that todays date would be blank and eveything after is OVERDUE?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Conditional columns

Hi @AMG16 ,

 

Create a custom column in Power Query like below.

if [date]<=Date.From(DateTime.LocalNow()) then "due" else ""

7.PNG 

When you refresh the dataset, the column will be changed.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

8 REPLIES 8
Highlighted
Super User IV
Super User IV

Re: Conditional columns

HI @AMG16 ,

 

I understand very little of what you are trying to achieve.

Can you share some sample data or screesnhots to understand your issue easily?

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Highlighted
Super User IX
Super User IX

Re: Conditional columns

@AMG16 , Are you trying to have a calculated column based on the slicer. That is not possible. You can have a measure.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper I
Helper I

Re: Conditional columns

I have files coming in to my report daily, for each file that is not the current date needs to be marked overdue.  Basically anything that is not the current date would be over due.  So today anything 7/22 and prior is over due then tomorrow anyhting 7/23 prior would be flagged and so on.

Highlighted
Helper I
Helper I

Re: Conditional columns

Here you go I placed teh data in excel.  I removed a lot of the other data elements, but you can see what im trying to do. Basically the file refershes each day.  Uses a column in PBI called  FOLLOW UP DATE this houses dates of the files.  I wanted to build a conditional column to call out all  over due files...files that have dates prior to todays date each day so tomorrow anything marked 7/23 would now have the over due tag.

 

MS PBI.png

Highlighted
Community Support
Community Support

Re: Conditional columns

Hi @AMG16 ,

 

Create a custom column in Power Query like below.

if [date]<=Date.From(DateTime.LocalNow()) then "due" else ""

7.PNG 

When you refresh the dataset, the column will be changed.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Highlighted
Helper I
Helper I

Re: Conditional columns

Thanks this seemed to work, but 1 issue im running into is all the blanks in the query editer are coming back showing NULL, so when I refresh the data it keeps flagging those as errors.  Anything I can add in the code to make blanks blank and not say NULL?

Highlighted
Helper I
Helper I

Re: Conditional columns

GM @v-jayw-msft 

 

Im using the code you gave me above and it works to bring back the due and over due.  Im running into an issue now that when the date field im bouncing off is empty it gives me an error in the custom column.

 

I tried removing Errors, but then it takes thoserows out of the data and we still need to see those.  How can I go about adding something telling it if the value is NULL in the date feild say blank or show a blank value in the custom column?

 

Thanks for the help in advance!

Highlighted
Helper I
Helper I

Re: Conditional columns

I figured if the conditon said if [RESOLVER_FOLLOW_UP_DATE]<Date.From(DateTime.LocalNow()) then "Over Due" else "Not Due" it would put that for a row that may be blank, but it doesnt and shows error for fields with no date.

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors