Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, I am new to Power BI.
I like to subtract two dates from eachother, that is a result from a relationship. It is like this.
table1.Date1 table2.Date2
1-1-2016 5-1-2016
5-2-2015 10-2-2016
Any idea how I get from the first row: 4(days) and the second row 5(days) as answer?
I have tried quiet some things but i get always problems in PowerBi row, where I enter the measure formula.
Your help is appreciated.
Peter
Solved! Go to Solution.
If you do not have the key column, we can add index column for both of tables and create relationship between them.
Then create a column in Table1 with following formula.
Subtract = IF ( Table1[Date1] < RELATED ( Table2[Date2] ), DATEDIFF ( Table1[Date1], RELATED ( Table2[Date2] ), DAY ), DATEDIFF ( RELATED ( Table2[Date2] ), Table1[Date1], DAY ) )
Best Regards,
Herbert
If you do not have the key column, we can add index column for both of tables and create relationship between them.
Then create a column in Table1 with following formula.
Subtract = IF ( Table1[Date1] < RELATED ( Table2[Date2] ), DATEDIFF ( Table1[Date1], RELATED ( Table2[Date2] ), DAY ), DATEDIFF ( RELATED ( Table2[Date2] ), Table1[Date1], DAY ) )
Best Regards,
Herbert
What is the key columns of the relationship between this 2 tables?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |