cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
caslus
Helper I
Helper I

Transform minutes to hour using filters

Hello guys, my first time here 🙂

So, I have one column filled with minutes and I need transform to HH:MM , but I need do this using filter where two column are equals, and another column is equal "Baixa". Actually I need to calculate the averange hourusing the filter. So I need Sum the hours, and divide for number of retorned lines " (Sum(columnMinute)/(Sum(DistinctCH)" the column Distinct have value "1" for each line.

I tried this way, but not working:

 

 

Campo Final Tempo Baixa LPJ = FORMAT(Consulta2[Var_Aux_Tempo Baixa LPJ]/60;"00") & ":" & FORMAT(MOD(Consulta2[Var_Aux_Tempo Baixa LPJ];60);"00") &":"& FORMAT(MOD(MOD(Consulta2[Var_Aux_Tempo Baixa LPJ]*60;60);60);"00") 

 

1º try

Var_Aux_Tempo Baixa LPJ = CALCULATE(SUM(Consulta2[FTO_AIDAtendTotLPJ])/SUM(Consulta2[Count_Distinct_id_Chamado]); FILTER(Consulta2;Consulta2[Prio.]="Baixa" && Consulta2[Var_MesAno_Atual] = Consulta2[Var_MesAno_Data_Criação] && Consulta2[FTO_AIDAtendTotLPJ] <> 0  ) )

 

2º try

Var_Aux_Tempo Baixa LPJ = IF(Consulta2[Prio.] = "Baixa" && Consulta2[Var_MesAno_Atual] = Consulta2[Var_MesAno_Data_Fechamento]; sum(Consulta2[FTO_AIDAtendTotLPJ]) ;0 )


image.png

 

And I wanna use late the page filter, filtering by the company

image.png


 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@caslus,

 

You may refer to the following DAX that creates a measure.

Average =
FORMAT (
    TIME ( 0, 0, AVERAGEX (
        FILTER (
            Consulta2,
            AND (
                Consulta2[Prio.] = "Baixa",
                Consulta2[Var_MesAno_Atual] = Consulta2[Var_MesAno_Data_Fechamento]
            )
        ),
        Consulta2[FTO_AIDAtendTotLPJ]
    )
        * 60 ),
    "HH:mm:ss"
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@caslus,

 

You may refer to the following DAX that creates a measure.

Average =
FORMAT (
    TIME ( 0, 0, AVERAGEX (
        FILTER (
            Consulta2,
            AND (
                Consulta2[Prio.] = "Baixa",
                Consulta2[Var_MesAno_Atual] = Consulta2[Var_MesAno_Data_Fechamento]
            )
        ),
        Consulta2[FTO_AIDAtendTotLPJ]
    )
        * 60 ),
    "HH:mm:ss"
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank You friend.

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors