Forum Discussion
Calculated Column with multiple conditions
- Anonymous3 years ago
Hi Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Please refer the following link to connect the XLS file in Power BI Desktop
Connect to Excel in Power BI Desktop - Power BI | Microsoft Learn
2. Create two calculated columns as below:
IsOverdue = IF ( NOT ( ISBLANK ( 'Action Log'[Date Closed] ) ), "NA", IF ( 'Action Log'[Due Date] < TODAY (), "Overdue", "Not due" ) )OverdueActions = IF ( 'Action Log'[IsOverdue] IN { "NA", "Not due" }, 0, DATEDIFF( 'Action Log'[Due Date], TODAY () ,DAY) )If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Please refer the following link to connect the XLS file in Power BI Desktop
Connect to Excel in Power BI Desktop - Power BI | Microsoft Learn
2. Create two calculated columns as below:
IsOverdue =
IF (
NOT ( ISBLANK ( 'Action Log'[Date Closed] ) ),
"NA",
IF ( 'Action Log'[Due Date] < TODAY (), "Overdue", "Not due" )
)OverdueActions =
IF (
'Action Log'[IsOverdue] IN { "NA", "Not due" },
0,
DATEDIFF( 'Action Log'[Due Date], TODAY () ,DAY)
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thank you! This looks so simple and logical now that you've done it, and yes it does exactly what I wanted it to do!!
I appreciate your help - that was super quick!
Many Thanks 🙂