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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
carloshluiz
Regular Visitor

Ajuda para Construir Formula

Olá pessoal,

 

Por favor, poderiam me ajudar a criar uma formula para trazer o resultado de acordo com a ultima coluna da tabela abaixo:

help.png

observações:

  • Se todas os Status da Ordem de Trabalho (4ªcoluna) estiverem fechados para o mesmo Chamado (1ª Coluna), deve retornar o status "Serviço Concluido, fechar chamado";
  • Se nem todos os Status da Ordem de Trabalho (4ª Coluna) estiverem fechados para o mesmo Chamado (1ª Coluna), deve retornar o status "Serviço não concluido, fazer Follow Up".

Eu sei realizar para uma unica linha, mas fazendo essa inteligência de olhar todos os status para o mesmo chamado não.

 

Podem me ajudar?

 

Abs,

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

Hi @carloshluiz ,

According to your description, here's my solution, create a calculated column.

Action =
IF (
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Status da Ordem de Trabalho] ),
        FILTER ( 'Table', 'Table'[Chamado] = EARLIER ( 'Table'[Chamado] ) )
    ) > 1,
    "Service not completed, do Follow Up",
    "Service Completed, Close Call"
)

Get the correct result.

vkalyjmsft_0-1653466028280.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

4 REPLIES 4
carloshluiz
Regular Visitor

@v-yanjiang-msft 

 

I will reformulate here my help for you to help me.

I need the system to return the "Service Completed, Close Call" message when all Work Order statuses are "Closed". If the work order still has a status of open, I cannot close the ticket. New example below:

 

help PBI.png

 

can you help me one more time?

Thanks for all the help 🙂

 

Hugs

v-yanjiang-msft
Community Support
Community Support

Hi @carloshluiz ,

According to your description, here's my solution, create a calculated column.

Action =
IF (
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Status da Ordem de Trabalho] ),
        FILTER ( 'Table', 'Table'[Chamado] = EARLIER ( 'Table'[Chamado] ) )
    ) > 1,
    "Service not completed, do Follow Up",
    "Service Completed, Close Call"
)

Get the correct result.

vkalyjmsft_0-1653466028280.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@carloshluiz , a new column like

 

new column =
var _count = countx (filter(Table, Table[Work Order] = earlier(Table[Work Order])),[Work Order]) // Work Order in column 1
var _complete = countx (filter(Table, Table[Work Order] = earlier(Table[Work Order]) && [status]= "Service Completed, Close Call"),[Work Order])
var _not = countx (filter(Table, Table[Work Order] = earlier(Table[Work Order]) && [status]= "Service not completed, do Follow Up"),[Work Order])
return
Switch(True() ,
_complete =_count , "Service Completed, Close Call" ,
_not =_count , "Service not completed, do Follow Up" ,
[status])

Hello.

Thank you for help. 

I'll try and I'll let you know.
thanks.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors