Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MP-iCONN
Resolver I
Resolver I

Custom Column to show Text and Column Value together based on Condition

I have an account statement I want to send out to our customers. 

 

This will consist of Invoice Number, PO #, Invoice Date, Due Date, then a calculated column on how many days Past Due, then finally a Balance $.

 

I will be showing all current and past due.  The problem is when we send them ones that are not past due I wanted a way to format it so it isn't negative so I thought maybe I could come up with a way to put in text and column value for all past due < 0.

 

I came up with this Power Query Custom Column but I want to know if something like this is even possible.

 

if [Past Due] > 0 [Past Due] else "Due in" && [Past Due]

 

So if past due is great than 0 keep it that number and if Past due < 0 the column would have Due in 34 days.  The other problem is converting that -34 to a positive so it shows Due in 34 Days rather than Due in -34 days.

 

So any advice would be greatly appreciated.   Thank you!

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

Something like the following should work...
if [Past Due] > 0 then [Past Due] else "Due in " & Text.From([Past Due]*-1) & " days"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
jgeddes
Super User
Super User

Something like the following should work...
if [Past Due] > 0 then [Past Due] else "Due in " & Text.From([Past Due]*-1) & " days"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





That was perfect!   Thank you very very much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.