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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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