Forum Discussion
How to calculate the date diff to calculate the date diff based on a value of one column
Thanks, of course you're correect. however, i've had dfifficulties calculating the datediff between the two columns since the trained date only populates on one row. is there a way to calculate the date diff between the trained date and date (sort of locking in on the one cell for the value of the trained date) or populate all the empty cells for dates before and after the trained date with the same value of trained date? then i would be able to calculate the datediff between the two columns. otherwise any tips that you can give me on index would be appreciated. the row is coming from a direct query (liked from another powerbi source) and not sure about inexing or if this can be done with a direct query at all.
thanks again for any assistance.
the row is coming from a direct query
Next time please mention this fact earlier.
you cannot implement column logic in Direct Query connections if the data does not come from the same row.
- ss85513 years ago
Helper II
so you do not have any suggestions on a resolution to my isssue? I did mention in my very first post that this was a direct query. I stated this since I knew that this could be an issue. Is there any way to either pull this data into antother tab and/or copy the data so that it fills all rows of the column?
- lbendlin3 years ago
Super User
You are right, I should have read your first post more attentively. I do not think there is a way to accomplish this in Power BI. This needs to be done at the data source.
- ss85513 years ago
Helper II
so i am using a direct query but, i also have other tabs. Is it possible to pull this data into another tab of Power BI that is not a Direct Query and then accomplish the same? I'm trying to use the data from the Direct Query to add to some additional data in Power BI that I have created using a Snowflake Connecton. If I add a coulumn into one of my tabs can I pull this data into one of these tabs and fill the empty cells either in this column or another column with this same date (so for example date of 1/1/22 to today to be filled with the date the training completed date)? so that I'm not trying to add it to a Direct Query directly but from a column i pulled in from a Direct Query to a new column in My Power BI.
Not sure if this works but looking for any way to get this to function.
Thanks againd for your assistance.