Beantwortet Better idea to display the datetime difference by DAX

  • יום שלישי 10 אפריל 2012 18:04
     
      קוד כלול

    Hello Friends,

     

    My customer request to show the "waiting time "as XX "d" XX "h"(eg. 3d4h, which means 3 days and 4 hours). So the calculatioon is straight enough as TODAY-orderDate.  I use the DAX to archieve this by 

    =IF(1.*(TODAY()-FactOrderLine[OrderFulldate])>=1, Round(1.*(TODAY()-FactOrderLine[OrderFulldate]), 0) & "d "& Mod(ROUND(24.*(TODAY()-FactOrderLine[OrderFulldate]),0), 24) & "h",ROUND(24.*(TODAY()-FactOrderLine[OrderFulldate]),0) & "h")

    But I am not sure whether this is the easiest way to do this.

    I doubt so. Any better and easier idea to implement this?


    Derek

כל התגובות

  • יום חמישי 12 אפריל 2012 05:50
    מנחה דיון
     
     תשובה

    Hi Derek,

    Since you want to customize the date's format rather than the standard format, you have to construct its string just like you mentioned.


    Challen Fu

    TechNet Community Support

    • סומן כתשובה על-ידי Challen FuModerator יום רביעי 18 אפריל 2012 10:04
    •