cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shamar123 Frequent Visitor
Frequent Visitor

Data comparison on two tables in direct query

Hi Gurus,

 

     I have  "created_date" in table A , "updated_date" in table B , data has been pulled through Direct query. Now i need to compare both the date fields from different tables as mentioned below.

 

  if( created_date > updated_date)

 then (created_date ) 

 else (updated_date).

 

1) Is it possible to achieve this scenario with direct queries

2) Basically am trying to find the maximum date by comparing these two dates. Any suggestion

 

Thanks,

Shamar

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Data comparison on two tables in direct query

Hi @Shamar123,

 

Try this measure.

 

Measure =
IF (
    MAX ( 'Table_3'[create date] ) > MAX ( 'Table_4'[update date] ),
    MAX ( 'Table_3'[create date] ),
    MAX ( 'Table_4'[update date] )
)

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Community Support Team
Community Support Team

Re: Data comparison on two tables in direct query

Hi @Shamar123,

 

By my tests, you could create the measure to compare the two date from different tables in Direct Query.

 

Capture.PNG

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Shamar123 Frequent Visitor
Frequent Visitor

Re: Data comparison on two tables in direct query

@v-piga-msft : Can you please explain a bit more to get clarity or can u pls share the code

Community Support Team
Community Support Team

Re: Data comparison on two tables in direct query

Hi @Shamar123,

 

Try this measure.

 

Measure =
IF (
    MAX ( 'Table_3'[create date] ) > MAX ( 'Table_4'[update date] ),
    MAX ( 'Table_3'[create date] ),
    MAX ( 'Table_4'[update date] )
)

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Support Team
Community Support Team

Re: Data comparison on two tables in direct query

Hi @Shamar123 ,

 

Have you solved your problem?

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.