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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello.

Thank you for help. 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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