Forum Discussion
Date difference based on condition
- 6 years ago
Hi tejapowerbi123 ,
You could try below measure and refer to my sample for details
Measure 2 = IF(MIN(TA[ID])=MIN(TB[ID]), DATEDIFF(MIN(TA[DATE]), MIN(TB[DATE]), DAY), BLANK())Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tejapowerbi123 of course if it is a blank date, you will not get the result. I cannot speak about your data, you have to test the logic where a date is available, not sure what else to say.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Thank you so much Parry.I can not change date column.Do you think do i have any other option.
- parry2k6 years ago
Super User
tejapowerbi123 not sure what you mean? You have to tell what would be the business logic if there is no date.
- tejapowerbi1236 years ago
Helper V
if id column match on table a and table then i want table a [date]-table b [date].That is the logic.
- dax6 years ago
Community Support
Hi tejapowerbi123 ,
You could try below measure and refer to my sample for details
Measure 2 = IF(MIN(TA[ID])=MIN(TB[ID]), DATEDIFF(MIN(TA[DATE]), MIN(TB[DATE]), DAY), BLANK())Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.