Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

select with direct query

Hello, This sql works in sql server and now I would like  to run it in power BI. So I thought may be I can somehow run the below query using direct query? How is it possible please? It seems I ca...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi,
    This seems good although now the issue is using your method I would like to add an extra column which is a calculation i.e.

    Select DateKey, [Quarter],Price
    ,sum(case when right(str(DateKey,8),4)=qd.StartMonthDayKey then Price else null end)

    over( order by DateKey) qPrice

    , CalculationPerformance = Price/qPrice - 1

    from tblFact f join #tblQuarterlyDate qd on f.Quarter=qd.QuarterKey

     

    Thank you