Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

Thank You friend.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.