Forum Discussion
Compare 2 Dates - IF Condition - HELP
- 5 years ago
If you want a calculated column fabiolamelo then the solution by danextian is what you need. If you want to do this in Power Query, you would use this:
= if [Date1] > [Date2] then "Late" else "Anticipated"If you need this in a measure, you will need to provide a bit more details with some data so we can help, but one fast way to try this is to use this measure:
Status = IF( MAX( 'Table'[Date1] ) > MAX( 'Table'[Date2] ), "Late", "Anticipated" )But that is a total stab in the dark as I don't know your expected output - not late/anticipated - but how you want to express it in a visual.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
If you want a calculated column fabiolamelo then the solution by danextian is what you need. If you want to do this in Power Query, you would use this:
= if [Date1] > [Date2] then "Late" else "Anticipated"
If you need this in a measure, you will need to provide a bit more details with some data so we can help, but one fast way to try this is to use this measure:
Status =
IF(
MAX( 'Table'[Date1] )
> MAX( 'Table'[Date2] ),
"Late",
"Anticipated"
)
But that is a total stab in the dark as I don't know your expected output - not late/anticipated - but how you want to express it in a visual.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
I didn't know that using MAX the IF condition for this case will works 🙂 Thank you so much for your help, I`m using the measure with MAX as you suggest and it was perfect 🙂 God bless you!