Forum Discussion

cbruhn42's avatar
cbruhn42
Helper III
2 years ago
Solved

Need Unique Date Time Field For Moving Average Chart

I have a data set that looks like this:   Date / Time    -    Production Order (Unique Value)   -    Brand    -    Phase   -    Value   -    Index   -     Moving Range   I sorted the data by phas...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from amitchandak.

     

    Hi cbruhn42  , 

    For you in the last paragraph of the problem description, I created a simple example data and realized the vision that you can apply that date column to the visual according to your own reality, here are my steps:

     

    1.Create simple data:

     

    2.Create a calculated column:

     

    UniqueDateTime =
    VAR _CurrentDate = 'Table'[Date / Time]
    VAR _RowNumber = 'Table'[Index]
    VAR _DuplicateCount =
    COUNTROWS(
    FILTER(
    'Table',
    'Table'[Date / Time] = _CurrentDate &&
    'Table'[Index] < _RowNumber
    )
    )
    RETURN
    IF(_DuplicateCount > 0,
    _CurrentDate + TIME( 0,0,_DuplicateCount),
    _CurrentDate)

     

    3.This achieves the effect of adding 1 to the number of seconds with the same time. 

     

    Best Regards,
    Zhu
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!