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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Dax HELP

Hello World,

I have this new column Days past dues (Days Past Dues = DATEDIFF(Sheet1[TransactionDate       ],Sheet1[PaymentDate   ],DAY). Days past dues gives me the days differences between transaction date and payment date

I have lots of negative days past dues which means the payment was done before the transaction date

Now, 

I want to create a column using some logical functions where the negative days (which means payment made earlier than the transaction date) means "Early Payment". And the one with postive days means "Late Payment". And the past due days which is 0 means"At time Payment".

2f134c94-9541-44dd-ae89-ca88022d8b84.png

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Payment Condition =
SWITCH (
    TRUE (),
    Sheet1[Days Past Dues] < 0, "Early Payment",
    Sheet1[Days Past Dues] > 0, "Late Payment",
    "At time Payment"
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Payment Condition =
SWITCH (
    TRUE (),
    Sheet1[Days Past Dues] < 0, "Early Payment",
    Sheet1[Days Past Dues] > 0, "Late Payment",
    "At time Payment"
)
Anonymous
Not applicable

@tamerj1 Sir, You're genius. It worked. Thank you Sir

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.