Forum Discussion

Narender's avatar
Narender
Icon for Resolver I rankResolver I
7 years ago
Solved

ABS function in Power Query column or in measure

Hi All,

 

I need to use the ABS function in Power BI.

 

 

SUM(ABS(ENTERED_DATE-CLOSED_DATE)/30)

 

How can I achieve this in Power BI??

 

 

Thanks,

 

Narender

 

 

3 Replies

  • PattemManohar's avatar
    PattemManohar
    Icon for Community Champion rankCommunity Champion

    Narender Please try adding as "Calculated Column" as below

     

    Diff = ABS(DATEDIFF(TestABS[EnteredDate],TestABS[ClosedDate],DAY))

    Then you can have a measure to calculate SUM of Diff

     

    Total =  SUM(TestABS[Diff])
    • Narender's avatar
      Narender
      Icon for Resolver I rankResolver I

      Hi, 

       

      Thanks for your feedback

       

      It is giving me right result.

       

      Can you please round it with 2 decimal points in same ABS formula?

       

       

       

      Thanks

       

      • PattemManohar's avatar
        PattemManohar
        Icon for Community Champion rankCommunity Champion

        Narender 

         

        Diff = ROUND(ABS(DATEDIFF(TestABS[EnteredDate],TestABS[ClosedDate],DAY)),2)