Forum Discussion

armvoss's avatar
armvoss
Icon for Helper I rankHelper I
4 years ago

Rounding minutes up

Hello,

 

i have a problem with a datetime value. i need to get the minutes of different entries to the same value. se pictures below.

i found a switch case solution that would look for the minutes in a given time and change it to what i need. but i lost the datepart. I tried to put something together in a new colum, but didnt work in the slicer for the visiual. 

 

Maybe there is a simpler solution? 

 

Thanks for the help.

 

I need that the time if the waage 17,18,19,20 is at the same time 02:30:00

 

4 Replies

    • armvoss's avatar
      armvoss
      Icon for Helper I rankHelper I

      PBIX 

       

      the data in question us 07.09.2022 02:30 and 02:29. For viewing purposes i need a solution that all measures are on 02:30

    • armvoss's avatar
      armvoss
      Icon for Helper I rankHelper I

      problem with the date slice is gone. like the on with the seconds. not sure why it was there in the first place

  • Hello,

    i found a solution for my problem:

     

    Spalte 2 = DATE(YEAR(GksMesswerte[Zeitpunkt]),MONTH(GksMesswerte[Zeitpunkt]),DAY(GksMesswerte[Zeitpunkt])
    ) + TIME(
        HOUR( GksMesswerte[Zeitpunkt] ),
        SWITCH(
        TRUE(),
            MINUTE( GksMesswerte[Zeitpunkt] ) >= 55, 55,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 50, 50,
            MINUTE( GksMesswerte[Zeitpunkt] ) >= 45, 45,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 40, 40,
            MINUTE( GksMesswerte[Zeitpunkt] ) >= 35, 35,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 30, 30,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 25, 30,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 20, 20,
            MINUTE( GksMesswerte[Zeitpunkt] ) >= 15, 15,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 10, 10,
            MINUTE( GksMesswerte[Zeitpunkt] ) >= 5, 5,
        MINUTE( GksMesswerte[Zeitpunkt] ) >= 0, 0
        ),
        0
     

     

    in the quickinfo last 2 columns. Last column "Zeitpunkt" is the column from the Database. "Spalte2" is my calculated column. But strange thing is: according to Power BI data is there until 12.09.22. But data is availabe till today. Even if i change the x axis back to original the newest date stays 12.09.2022
     

     

    but the entries in the data base are there

     

     

    can anyone help?

     

    )