Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello All
how to calcualte difference of days between two dates from two tables, Also what happenes if source columns values are expected nulls how to handle this in logic.
Salesdate - sales table
Orderdate - order table
date diff( salesdate, orderdate, days)..?
Solved! Go to Solution.
Hi @refint650
Thanks for reaching out to us.
First, you need to find the dates you want to compare from the two tables, and then use the datediff function.
for example,
measure=
var _date1= minx(filter(table1,table1[column1]="xxx"), [Salesdate])
var _date2= minx(filter(table2,table2[column1]="xxx"), [Orderdate])
return datediff(_date1,_date2,day)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @refint650
Thanks for reaching out to us.
First, you need to find the dates you want to compare from the two tables, and then use the datediff function.
for example,
measure=
var _date1= minx(filter(table1,table1[column1]="xxx"), [Salesdate])
var _date2= minx(filter(table2,table2[column1]="xxx"), [Orderdate])
return datediff(_date1,_date2,day)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@refint650 , You need a common dimension joined to both tables
Sumx(Values(Order[Order]) , datediff( Min(sales[salesdate], max(Order[orderdate], days) )
same as this one
without agreagate function alternate way to find difference of date columns from two tables.?
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
51 | |
50 | |
48 |