Forum Discussion
Substract time columns from diff datasets
Hi LearnerMM
Thanks for clarifying. If Power BI isn’t letting you select columns across datasets, it’s likely due to how the model is set up especially if you're using a composite model (Import + DirectQuery) or separate sources without an active relationship.
If Table1[EST] is the scheduled time and Table2[EST Start] is the actual time, and there's a one-to-many relationship from Table1 to Table2, you can write a calculated column in Table2 like this:
DelayMinutes =
DATEDIFF(
RELATED(Table1[EST]),
Table2[EST Start],
MINUTE
)
Double-check your relationship direction in the model view. Make sure you’re referencing from the correct side (many side → one side) when using RELATED(). If you're using different sources, consider merging them in Power Query or creating a bridge table with shared keys.
Hey Thanks rohit1991 Deku danextian ...... actually problem is - It dose not pull out column name from other datasource.
We can substract 2 columns from same data source - but if you try to select another datasource columns , Power BI is not giving me option to select from other datasource.
Can Iconnect with anyone of you ?
Thanks
Mangesh M
- danextian1 year agoSuper User
Can you please show your diagram/relationship view? If there's a direct one-to-many relationship between the two tables, you should be able to use RELATED on the many side. The RELATED function cannot be used on the "one" side of a one-to-many relationship because there could be multiple matching rows in the related table, and RELATED does not perform aggregation.