Forum Discussion

J918's avatar
J918
Frequent Visitor
2 years ago
Solved

Datediff slicer not correct

I have this DAX code to show how many minutes a process ran: 

Process Time Minutes = DATEDIFF(META[PROCESS_START_TIME], META[PROCESS_END_TIME], MINUTE)
 
I then put a slicer:

However, it's showing anything less than 1 minute, but more than 1 second as 1 minute.  If I have the minimum time on 1, it should not show any rows less than 1 minute.  

 

For example, these rows are returned with the slicer above applied, but shouldn't.  

 

 

Please help! 

  • I figured it out.  Changed my DAX to:

     

    Process Time Minutes = DATEDIFF(META[PROCESS_START_TIME], META[PROCESS_END_TIME], SECOND) / 60

3 Replies

  • J918's avatar
    J918
    Frequent Visitor

    I figured it out.  Changed my DAX to:

     

    Process Time Minutes = DATEDIFF(META[PROCESS_START_TIME], META[PROCESS_END_TIME], SECOND) / 60
  • J918 - The slicer is turning the correct values for what you are doing. In order for this to work, you will need to turn your column into an integer for minutes, try:

     

     

    DATEDIFF(META[PROCESS_START_TIME], META[PROCESS_END_TIME], SECOND) / 60

     

     

    If this works, please accept it as a solution.

  • Anonymous's avatar
    Anonymous
    Not applicable

    J918 

    We are really glad to know that the problem has been solved. We're also glad that you've shared your solution in the community, it's very helpful.

     

    Please consider accepting your post as a solution to help other members find solutions faster.

     

    Certainly, if there is anything else we can do for you, please do not hesitate to contact us.

    Best Regards,

    Leroy Lu