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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.