Forum Discussion
Date Diff. Using Today() function
vanessafvg I have also tried but it's not working,
When i use this column my main table show up : Can't display
- vishalbaldania9 years agoHelper I
vanessafvg When i upload excel sheet in to power bi, the formula is working
but when i am working with my actual data set which is avalible in Orecal it's not working... Do you what should i do?
- vanessafvg9 years agoCommunity Champion
vishalbaldania and you importing it from oracle? or is it a live connection? there is limited functionality with live connections
- vishalbaldania9 years agoHelper I
vanessafvg Sorry, I missed it. It was in live that why, i was getting problem. but after changed in to imported it's working.
But As you can see in below image thare are some cells are empty i want to write there "Days Next Due". Like in excel formula:
Over Due - Days: Excel Formula: =IF(ISBLANK(D2),"",IF(D2<TODAY(),DATEDIF(D2,TODAY(),"d"),"Days Next Due"))
Power BI Formula: Column = IF(EQ_SCHEDJOB[NEXT_DUE_DT] < TODAY(), DATEDIFF('EQ_SCHEDJOB'[NEXT_DUE_DT], TODAY(), DAY)) - Working Good
Column = IF(EQ_SCHEDJOB[NEXT_DUE_DT] < TODAY(), DATEDIFF('EQ_SCHEDJOB'[NEXT_DUE_DT], TODAY(), DAY, "Days Next Due")) - Getting Error please see image
- vanessafvg9 years agoCommunity Champion
so I understand what you asking, what is the objective of your formula?
to check if there is date, if there is and its < than today, run the date diff and return a day value, otherwise, if not then put the text in the same column 'days next due'? or are you trying to name the column?
- vishalbaldania9 years agoHelper I
vanessafvg The objective of the formula is:
Excel Formula: IF(D2<TODAY(),DATEDIF(D2,TODAY(),"d"),"Days Next Due"))
The D2 cell has next due date for the equipment and if it < today's date then result would be the text "Days Next Due" intend of empty cell.
and if the next due date for the equipment > today's date then result would be the "Number in days like: 127, 70..."
As you can see in power bi image there are so many empty cell are there but in excel sheet it's occupied. If it is possible, my report would be very easy to understand for the user.
Please find attached photo
- vanessafvg9 years agoCommunity Champion
vishalbaldania its because you are mixing your data types, you are getting a numeric calculation but you want to then put a text in the column. This is where its different to excel because excel wont mind but power bi will. You will need to come up with a numeric indicator for days next due like -1 or something.