Forum Discussion

kee's avatar
kee
Frequent Visitor
7 years ago
Solved

Excel formula to Power BI

Hi,

 

Can anyone help me to convert the below excel formula to power BI DAX?

 

=SUMIFS([@[NET OWING]],[@DATE],">="&TODAY()-15)

 

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    =CALCULATE (
        SUM ( Table1[NET OWING] ),
        FILTER ( Table1, Table1[Date] >= ( TODAY () - 15 ) )
    )

  • Anonymous's avatar
    Anonymous
    7 years ago

    It'll basically be the same formula but twice, with the days changed to 59 and 29

     

    CALCULATE (
        SUM ( Table1[NET OWING] ),
        FILTER ( Table1, Table1[Date] >= ( TODAY () - 59 ) )
    )
        - CALCULATE (
            SUM ( Table1[NET OWING] ),
            FILTER ( Table1, Table1[Date] >= ( TODAY () - 29 ) )
        )

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    =CALCULATE (
        SUM ( Table1[NET OWING] ),
        FILTER ( Table1, Table1[Date] >= ( TODAY () - 15 ) )
    )

    • kee's avatar
      kee
      Frequent Visitor

      Thanks Chirayuw.

       

      Can you help me again to covert the excel formula below?

       

      =SUMIFS([@[NET OWING]],[@Date],">="&TODAY()-59)-SUMIFS([@[NET OWING]],[@Date],">="&TODAY()-29)

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        It'll basically be the same formula but twice, with the days changed to 59 and 29

         

        CALCULATE (
            SUM ( Table1[NET OWING] ),
            FILTER ( Table1, Table1[Date] >= ( TODAY () - 59 ) )
        )
            - CALCULATE (
                SUM ( Table1[NET OWING] ),
                FILTER ( Table1, Table1[Date] >= ( TODAY () - 29 ) )
            )