SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
* Apenas para entender, no Power BI você deve usar a fórmula em Inglês
Categoria Fórmula Equivalente em Português* Sintaxe Exemplo (Apenas para Ilustrar) O que faz?
SUM SOMA =SUM(Coluna) =SUM(BaseFuncionarios[VT]) Soma números ou colunas
AVERAGE MÉDIA =AVERAGE(Coluna) =AVERAGE(BaseFuncionarios[VT]) Calcula a média de números ou colunas
MAX MÁXIMO =MAX(Coluna) =MAX(BaseFuncionarios[VT]) Calcula o maior valor de uma lista ou coluna
MIN MÍNIMO =MIN(Coluna) =MIN(BaseFuncionarios[VT]) Calcula o menor valor de uma lista ou coluna
COUNT CONT.NÚM =COUNT(Coluna) =COUNT(BaseFuncionarios[VT]) Conta quantos números tem em uma coluna
COUNTA CONT.VALORES =COUNTA(Coluna) =COUNTA(BaseFuncionarios[VT]) Conta quantos valores tem em uma coluna
COUNTROWS CONTAR LINHAS =COUNTROWS(Coluna) =COUNTROWS(BaseFuncionarios[VT]) Conta quantas linhas tem em uma coluna
DISTINCTCOUNT CONTAGEM DISTINTA =DISTINCTCOUNT(Coluna) =DISTINCTCOUNT(BaseFuncionarios[VT]) Conta quantos itens diferentes tem em uma coluna
SUMX SOMAX =SUMX(Tabela;Expressão) =SUMX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Soma o resultado de uma expressão
AVERAGEX MÉDIAX =AVERAGEX(Tabela;Expressão) =AVERAGEX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Calcula a média do resultado de uma expressão
MAXX MÁXIMOX =MAXX(Tabela;Expressão) =MAXX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Calcula o maior valor do resultado de uma expressão
MINX MÍNIMOX =MINX(Tabela;Expressão) =MINX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Calcula o menor valor do resultado de uma expressão
COUNTX CONT.NÚMX =COUNTX(Tabela;Expressão) =COUNTX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Conta quantos números tem no resultado de uma expressão
IF SE =IF(Teste;Valor Verdadeiro; Valor Falso) =IF(BaseClientes[Valor Contrato Anual]>400000;"Muito Crítico";"Normal")
Trata uma condição e retorna um valor se a condição for verdade e
outro se for falsa
IFERROR SEERRO =IFERROR(Expressão;Valor se Erro) =IFERROR(BaseFuncionarios[VT]+BaseFuncionarios[VR];0) Trata um erro, substituindo o erro por outro valor
AND E =E(Condição1; Condição2)
=E(BaseClientes[Valor Contrato Anual]>20000; BaseClientes[Valor Contrato
Anual]<40000)
Permite tratar mais de uma condição ao mesmo tempo, retornando
verdadeiro se todas forem verdadeiras
OR OU =OU(Condição 1; Condição 2)
=OU(BaseClientes[Valor Contrato Anual]>40000; BaseClientes[Nivel de
Importancia]=4)
Permite tratar mais de uma condição ao mesmo tempo, retornando
verdadeiro se pelo menos uma delas for verdadeira
TRUE VERDADEIRO =TRUE() =TRUE() Retorna Verdadeiro
FALSE FALSO =FALSE() =FALSE() Retorna Falso
CONCATENATE CONCATENAR =CONCATENATE(Coluna1;Coluna2) =CONCATENATE(BaseFuncionarios[Nome];" ";BaseFuncionarios[Sobrenome]) Junta textos
LEFT ESQUERDA =LEFT(Coluna1; Qtde Caracteres) =LEFT(BaseFuncionarios[COD];4) Pega a parte à esquerda de um texto
RIGHT DIREITA =RIGHT(Coluna1; Qtde Caracteres) =RIGHT(BaseFuncionarios[COD];5) Pega a parte à direita de um texto
MID EXT.TEXTO =MID(Coluna1; Posição Inicial; Qtde Caracteres) =MID(BaseFuncionarios[COD];5;3) Pega uma parte do meio de um texto
UPPER MAIÚSCULA =UPPER(Coluna1) =UPPER(BaseFuncionarios[Nome]) Transforma em letra maiúscula
LOWER MINÚSCULA =LOWER(Coluna1) =LOWER(BaseFuncionarios[Nome]) Transforma em letra minúscula
LEN NÚM.CARACT =LEN(Coluna1) =LEN(BaseFuncionarios[Nome]) Conta quantos caracteres tem um texto
SEARCH PROCURAR
=SEARCH(Texto Procurando; Coluna1; [Posição Inicial]; [Valor
se não encontrar]) =SEARCH("-"; BaseFuncionarios[COD]) Retorna a posição de um caractere dentro de um texto
SUBSTITUTE SUBSTITUIR
=SUBSTITUTE(Coluna1;Texto Antigo; Texto Novo;
[Ocorrência]) =SUBSTITUTE(BaseFuncionarios[Nome];" ";"-") Troca um pedaço do texto por outra coisa
TRIM ARRUMAR =TRIM(Coluna1) =TRIM(BaseFuncionarios[Nome])
Tira espaços extras (antes do texto, espaço duplo, espaço no final,
etc.)
DAY DIA =DAY(Coluna1) =DAY(BaseCalendario[Data]) Retorna o dia do mês de uma data
MONTH MÊS =MONTH(Coluna1) =MONTH(BaseCalendario[Data]) Retorna o número do mês de uma data
YEAR ANO =YEAR(Coluna1) =YEAR(BaseCalendario[Data]) Retorna o ano de uma data
TODAY HOJE =TODAY() =TODAY() Retorna a data de hoje
WEEKDAY DIA.DA.SEMANA =WEEKDAY(Coluna1;[Tipo]) =WEEKDAY(BaseCalendario[Data]) Retorna o dia da semana de uma data (número de 1 a 7)
WEEKNUM NÚMSEMANA =WEEKNUM(Coluna1;[Tipo]) =WEEKNUM(BaseCalendario[Data]) Retorna a semana do ano de uma data (número de 1 a 52)
HOUR HORA =HOUR(Coluna1) =HOUR(BaseCalendario[Data]) Retorna a hora de uma data com horário
MINUTE MINUTO =MINUTE(Coluna1) =MINUTE(BaseCalendario[Data]) Retorna os minutos de uma data com horário
SECOND SEGUNDO =SECOND(Coluna1) =SECOND(BaseCalendario[Data]) Retorna os segundos de uma data com horário
NOW AGORA =NOW() =NOW() Retorna a data de hoje com a hora de agora
DATEDIFF DIFERENÇA DE DATA =DATEDIFF(Data1; Data2; Tipo) =DATEDIFF(BaseCalendario[Datas];TODAY();YEAR)
Calcula a diferença entre 2 datas em um formato especificado
(diferença em dias, em anos, em meses, etc.)
CALCULATE CALCULAR =CALCULATE(Expressão; Filtro1; [Filtro2];...)
=CALCULATE(SUM(BaseFuncionarios[SalarioTotal]);BaseFuncionarios[Persona
lizado]="Funcionário Atual") Calcula uma expressão em uma tabela filtrada
FILTER FILTRAR =FILTER(Tabela;Filtro1;[Filtro2];...)
=FILTER(BaseClientes;BaseClientes[Valor por Serviço]>[VALOR MEDIO P/
CONTRATO]) Filtra uma tabela com vários critérios
ALL TODOS =ALL(Tabela;[Coluna1];...) =ALL(BaseClientes) Exclui qualquer filtro de uma tabela
RELATED RELATIVO =RELATED(Coluna1) =RELATED(BaseCargos[Nível]) Puxa uma informação de uma coluna
Fórmula Básica
Fórmula Iterativa
Fórmula Lógica
Fórmula de Texto
Fórmula de Data
Fórmula de Filtro

Mais conteúdo relacionado

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Fórmulas DAX.pdf

  • 1. * Apenas para entender, no Power BI você deve usar a fórmula em Inglês Categoria Fórmula Equivalente em Português* Sintaxe Exemplo (Apenas para Ilustrar) O que faz? SUM SOMA =SUM(Coluna) =SUM(BaseFuncionarios[VT]) Soma números ou colunas AVERAGE MÉDIA =AVERAGE(Coluna) =AVERAGE(BaseFuncionarios[VT]) Calcula a média de números ou colunas MAX MÁXIMO =MAX(Coluna) =MAX(BaseFuncionarios[VT]) Calcula o maior valor de uma lista ou coluna MIN MÍNIMO =MIN(Coluna) =MIN(BaseFuncionarios[VT]) Calcula o menor valor de uma lista ou coluna COUNT CONT.NÚM =COUNT(Coluna) =COUNT(BaseFuncionarios[VT]) Conta quantos números tem em uma coluna COUNTA CONT.VALORES =COUNTA(Coluna) =COUNTA(BaseFuncionarios[VT]) Conta quantos valores tem em uma coluna COUNTROWS CONTAR LINHAS =COUNTROWS(Coluna) =COUNTROWS(BaseFuncionarios[VT]) Conta quantas linhas tem em uma coluna DISTINCTCOUNT CONTAGEM DISTINTA =DISTINCTCOUNT(Coluna) =DISTINCTCOUNT(BaseFuncionarios[VT]) Conta quantos itens diferentes tem em uma coluna SUMX SOMAX =SUMX(Tabela;Expressão) =SUMX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Soma o resultado de uma expressão AVERAGEX MÉDIAX =AVERAGEX(Tabela;Expressão) =AVERAGEX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Calcula a média do resultado de uma expressão MAXX MÁXIMOX =MAXX(Tabela;Expressão) =MAXX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Calcula o maior valor do resultado de uma expressão MINX MÍNIMOX =MINX(Tabela;Expressão) =MINX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Calcula o menor valor do resultado de uma expressão COUNTX CONT.NÚMX =COUNTX(Tabela;Expressão) =COUNTX(BaseFuncionarios;[VT]+[VR]+[Beneficios]) Conta quantos números tem no resultado de uma expressão IF SE =IF(Teste;Valor Verdadeiro; Valor Falso) =IF(BaseClientes[Valor Contrato Anual]>400000;"Muito Crítico";"Normal") Trata uma condição e retorna um valor se a condição for verdade e outro se for falsa IFERROR SEERRO =IFERROR(Expressão;Valor se Erro) =IFERROR(BaseFuncionarios[VT]+BaseFuncionarios[VR];0) Trata um erro, substituindo o erro por outro valor AND E =E(Condição1; Condição2) =E(BaseClientes[Valor Contrato Anual]>20000; BaseClientes[Valor Contrato Anual]<40000) Permite tratar mais de uma condição ao mesmo tempo, retornando verdadeiro se todas forem verdadeiras OR OU =OU(Condição 1; Condição 2) =OU(BaseClientes[Valor Contrato Anual]>40000; BaseClientes[Nivel de Importancia]=4) Permite tratar mais de uma condição ao mesmo tempo, retornando verdadeiro se pelo menos uma delas for verdadeira TRUE VERDADEIRO =TRUE() =TRUE() Retorna Verdadeiro FALSE FALSO =FALSE() =FALSE() Retorna Falso CONCATENATE CONCATENAR =CONCATENATE(Coluna1;Coluna2) =CONCATENATE(BaseFuncionarios[Nome];" ";BaseFuncionarios[Sobrenome]) Junta textos LEFT ESQUERDA =LEFT(Coluna1; Qtde Caracteres) =LEFT(BaseFuncionarios[COD];4) Pega a parte à esquerda de um texto RIGHT DIREITA =RIGHT(Coluna1; Qtde Caracteres) =RIGHT(BaseFuncionarios[COD];5) Pega a parte à direita de um texto MID EXT.TEXTO =MID(Coluna1; Posição Inicial; Qtde Caracteres) =MID(BaseFuncionarios[COD];5;3) Pega uma parte do meio de um texto UPPER MAIÚSCULA =UPPER(Coluna1) =UPPER(BaseFuncionarios[Nome]) Transforma em letra maiúscula LOWER MINÚSCULA =LOWER(Coluna1) =LOWER(BaseFuncionarios[Nome]) Transforma em letra minúscula LEN NÚM.CARACT =LEN(Coluna1) =LEN(BaseFuncionarios[Nome]) Conta quantos caracteres tem um texto SEARCH PROCURAR =SEARCH(Texto Procurando; Coluna1; [Posição Inicial]; [Valor se não encontrar]) =SEARCH("-"; BaseFuncionarios[COD]) Retorna a posição de um caractere dentro de um texto SUBSTITUTE SUBSTITUIR =SUBSTITUTE(Coluna1;Texto Antigo; Texto Novo; [Ocorrência]) =SUBSTITUTE(BaseFuncionarios[Nome];" ";"-") Troca um pedaço do texto por outra coisa TRIM ARRUMAR =TRIM(Coluna1) =TRIM(BaseFuncionarios[Nome]) Tira espaços extras (antes do texto, espaço duplo, espaço no final, etc.) DAY DIA =DAY(Coluna1) =DAY(BaseCalendario[Data]) Retorna o dia do mês de uma data MONTH MÊS =MONTH(Coluna1) =MONTH(BaseCalendario[Data]) Retorna o número do mês de uma data YEAR ANO =YEAR(Coluna1) =YEAR(BaseCalendario[Data]) Retorna o ano de uma data TODAY HOJE =TODAY() =TODAY() Retorna a data de hoje WEEKDAY DIA.DA.SEMANA =WEEKDAY(Coluna1;[Tipo]) =WEEKDAY(BaseCalendario[Data]) Retorna o dia da semana de uma data (número de 1 a 7) WEEKNUM NÚMSEMANA =WEEKNUM(Coluna1;[Tipo]) =WEEKNUM(BaseCalendario[Data]) Retorna a semana do ano de uma data (número de 1 a 52) HOUR HORA =HOUR(Coluna1) =HOUR(BaseCalendario[Data]) Retorna a hora de uma data com horário MINUTE MINUTO =MINUTE(Coluna1) =MINUTE(BaseCalendario[Data]) Retorna os minutos de uma data com horário SECOND SEGUNDO =SECOND(Coluna1) =SECOND(BaseCalendario[Data]) Retorna os segundos de uma data com horário NOW AGORA =NOW() =NOW() Retorna a data de hoje com a hora de agora DATEDIFF DIFERENÇA DE DATA =DATEDIFF(Data1; Data2; Tipo) =DATEDIFF(BaseCalendario[Datas];TODAY();YEAR) Calcula a diferença entre 2 datas em um formato especificado (diferença em dias, em anos, em meses, etc.) CALCULATE CALCULAR =CALCULATE(Expressão; Filtro1; [Filtro2];...) =CALCULATE(SUM(BaseFuncionarios[SalarioTotal]);BaseFuncionarios[Persona lizado]="Funcionário Atual") Calcula uma expressão em uma tabela filtrada FILTER FILTRAR =FILTER(Tabela;Filtro1;[Filtro2];...) =FILTER(BaseClientes;BaseClientes[Valor por Serviço]>[VALOR MEDIO P/ CONTRATO]) Filtra uma tabela com vários critérios ALL TODOS =ALL(Tabela;[Coluna1];...) =ALL(BaseClientes) Exclui qualquer filtro de uma tabela RELATED RELATIVO =RELATED(Coluna1) =RELATED(BaseCargos[Nível]) Puxa uma informação de uma coluna Fórmula Básica Fórmula Iterativa Fórmula Lógica Fórmula de Texto Fórmula de Data Fórmula de Filtro