Forum Discussion
MahamoodBi
4 years agoFrequent Visitor
Need to find date difference between two different tables in power bi
Hi PBI Experts, I have Table 1 and Table2 data in Table1 i have a ''Service date'' Column and Table2 i have Termdate column , i need to findout date difference between (Table1)Servic...
SergioSilvaPT
Resolver V
4 years ago
Check your solution in DAX:
Output =
ADDCOLUMNS(
ADDCOLUMNS(
SUMMARIZE(
'Table 1',
'Table 1'[Empid],
'Table 1'[status],
'Table 1'[Servicedate]
),
"Action", LOOKUPVALUE('Table 2'[Action],'Table 2'[Empid],'Table 1'[Empid]),
"Date Diff", DATEDIFF( [Servicedate], LOOKUPVALUE('Table 2'[Termdate],'Table 2'[Empid],'Table 1'[Empid]),MONTH)
),
"DateDiff/12", DIVIDE([Date Diff] , 12,0)
)
Regards,
Sérgio Silva
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Sérgio Silva
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
MahamoodBi
4 years agoFrequent Visitor
- SergioSilvaPT4 years ago
Resolver V
MahamoodBi you're trying to create a measure with a DAX code that results a table.
Instead of New measure choose New table and copy the DAX code.
Regards,
Sérgio Silva
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.