Forum Discussion

vaishalisah's avatar
vaishalisah
Regular Visitor
9 years ago
Solved

Multiply rows of two category based on different datetime frequency

Hello,   I need the following scenario to be achieved in Direct query mode. I was able to achieve it in Data Import mode but in Direct Query I see that the transformations and DAX formulas are quit...
  • v-caliao-msft's avatar
    9 years ago

    Hi vaishalisah,

     

    I need the following scenario to be achieved in Direct query mode. I was able to achieve it in Data Import mode.

    To achieve this requirement in direct query mode, you need to use query to do it. In your scenario, which datasource are you using?

     

    For the relational table, you ca use the query below.

    select a.TimeStamp,CAST(a.Cat_Value as varchar)+'*'+cast((select MAX(b.Cat_Value) from test5 b where b.Category='A' and b.TimeStamp<=a.TimeStamp) as varchar) as [Product(A,B)] from test5 a where a.Category='B'

     

    Regards,

    Charlie Liao