Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello!!
I have the 2 sample tables below. I am trying to perform a calculation by using "DATEDIFF" function between 'Table 1'[Date Event Enter] and 'Table 2'[Date Action Started]. There is a relationship (Many to 1) between both tables using "Event ID" ("Event ID" for Table 1 has unique values) and both tables have over 30 columns that are not shown below. Table 2 does not have the same number of rows as Table 1.
In Power BI, I can use the relationship established between both Tables and come up with the Table below. However, I do not know if there a way to make the calculation by using the data from this table created in Power BI. Ahy help is appreciated. Thank you for your time in advanced!
Solved! Go to Solution.
Hi @elponce,
If above created table is a table visual, it is not possible to make calculations by using the data from it. If this created table is a calculated table or a merged table in Query Editor, you can use data from it.
In your scenario, since there existing a one to many relationship between Table 1 and Table 2, you can calculate the difference between two dates via creating a calculated column in Table 2.
Datediff = DATEDIFF(RELATED('Table 1'[Date Event]),'Table 2'[Date Action Started],DAY)
Best regards,
Yuliana Gu
Hi @elponce,
If above created table is a table visual, it is not possible to make calculations by using the data from it. If this created table is a calculated table or a merged table in Query Editor, you can use data from it.
In your scenario, since there existing a one to many relationship between Table 1 and Table 2, you can calculate the difference between two dates via creating a calculated column in Table 2.
Datediff = DATEDIFF(RELATED('Table 1'[Date Event]),'Table 2'[Date Action Started],DAY)
Best regards,
Yuliana Gu
User | Count |
---|---|
115 | |
95 | |
87 | |
76 | |
65 |
User | Count |
---|---|
138 | |
113 | |
110 | |
98 | |
93 |