cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lognet
New Member

Convert DAX to M language

Hi guys,

 

I need help to convert 2 formulas DAX to M language.

 

The first one I think it's easy. 

 

Coluna = 

IF(
 CALCULATE(
   COUNTROWS('1_Pagamentos');
        FILTER('1_Pagamentos';
             '1_Pagamentos'[DT.CRÉDITO]>TODAY()-180&&
             '1_Pagamentos'[GRUPO]=EARLIER('0_Grupos'[GRUPO])))+

 CALCULATE(
    COUNTROWS('2_Cobrança');
        FILTER('2_Cobrança';
             '2_Cobrança'[Dt.Emissão]>TODAY()-360&&
             '2_Cobrança'[GRUPO]=EARLIER('0_Grupos'[GRUPO])))>0;

"ATIVO";"INATIVO")

The second I don't know if it's possible.

 

Exposição = 

CALCULATE(
   SUM('1_Pagamentos'[Val. Movimento]);
       FILTER('1_Pagamentos';
              '1_Pagamentos'[DT.CRÉDITO]>EARLIER('Exposição'[DATA])&&
              '1_Pagamentos'[Dt.Emissão<=EARLIER('Exposição'[DATA])&&
              '1_Pagamentos'[GRUPO]=EARLIER('Exposição'[GRUPO])))+

CALCULATE(
   SUM('2_Cobrança'[VAL.SALDO]);
       FILTER('2_Cobrança';
              '2_Cobrança'[Dt.Emissão<=EARLIER('Exposição'[DATA])&&
              '2_Cobrança'[GRUPO]=EARLIER('Exposição'[GRUPO])))

Thanks

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Lognet,

 

Why do you want to convert your dax formula to M query? If you create the column with M query, it won't be dynamically in Power BI.

 

I'm not good at M Query.  @ 

 

 

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.

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors