Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
glaucolrc
New Member

Translating SQL Queries to DAX Queries

Sirs,

I'm having trouble converting this sql query to dax.

SELECT SUM(VALOR)
       FROM TB_Lancamentos
       WHERE TipoLancamento = 'RPIU'
           AND NOT EXISTS ( SELECT ID_Lancamento
                                             FROM TB_Lancamentos
                                             WHERE TipoLancamento = 'ARPIU'
                                                 AND ID_Lancamento_Pai NOT IN ( SELECT ID_Lancamento
                                                                                                              FROM TB_Lancamentos
                                                                                                               WHERE TipoLancamento = 'RPIU'
                                                                                                        )
                                         );

Can you help me?
Thanks.

 

1 REPLY 1
lbendlin
Super User
Super User

Instead of trying to convert apples to oranges (also known as "fighting the API") you will want to write down the business question you are planning to answer, and then you can construct your Power Query or DAX code step by step to solve that question.

 

Please provide sample data in usable format (not as a picture) and show the expected outcome.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.