Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 months ago
Solved

Replicating SQL query in Power BI

Basically I want to replicate in power bi. Since calculated tables are not supported in DirectQuery, what is the best measure-based approach in Power BI to replicate this logic? Any guidance or be...
  • MFelix's avatar
    7 months ago

    Hi Anonymous ,

     

    If you want to create this table in Power BI using direct query you can use this exact SQL statement you only need to use the advance options on the SQL connection and past your SQL code on the window that show for SQL query:

     

     

    If this is not what you need can you please elaborate better on what you want to achieve and how your model is setup, since there is no direct syntax between SQL and DAX queries

     

  • v-csrikanth's avatar
    7 months ago

    Hi Anonymous 
     MFelix Thanks for the clarification shared above.

    Using the SQL statement in the Advanced options with DirectQuery addresses the requirement and preserves the original SQL logic. If the goal differs from this approach, additional details on the model setup and expected output would help clarify next steps.

    If you still need assistance, we are happy to assist you or any other new issue you're welcome to start a new thread in the community at any time.

    We appreciate your understanding and participation.

    Thanks and Regards,
    Cheri Srikanth
    CST Team.