Casos de uso y modelo de datos con DAX
¿Cuándo utilizar DAX en Power BI?
Modelo de datos del proyecto de ventas de vehículos
¿Cómo afecta la dirección de filtro en Power BI?
Quiz: Casos de uso y modelo de datos con DAX
Creación de tablas y columnas con DAX
Columna calculada
Tablas calculadas
Quiz: Creación de tablas y columnas con DAX
Medidas
¿Cuándo crear una medida con DAX?
¿Cuáles son las principales funciones de agregación de DAX?
Manipulación de texto con DAX
Funciones lógicas y condicionales: IF, AND, OR
Funciones lógicas y condicionales anidadas: IF, SWITCH
Funciones lógicas y condicionales: HASONEVALUE
Funciones lógicas y condicionales: SELECTEDVALUE
Filtrado de datos con FILTER y SEARCH
Quiz: Medidas
CALCULATE
Uso de CALCULATE en Power BI
CALCULATE con ALL y ALLEXCEPT
Quiz: CALCULATE
Manejo de Iteradores y contextos
Iteradores X: cálculos por fila
Clasificación y ordenamiento de datos con RANKX y TOP
Evaluación de contextos con CALCULATE
Quiz: Manejo de Iteradores y contextos
Funciones de inteligencia de tiempo
Análisis de fechas y tiempo con DAX
Análisis de crecimiento acumulado en el tiempo con DAX
Quiz: Funciones de inteligencia de tiempo
Optimización de modelos y escritura de código DAX
Uso de variables para optimizar fórmulas en DAX
Mejorar legibilidad de código con DAX Formatter
Evaluación de modelo de datos con DAX Studio
Mantenimiento de modelos de datos con Tabular Editor
¿Cómo escribir código DAX con ChatGPT?
AI Visuals para interpretar el modelo de datos
Integración de medidas en reporte de Power BI
Reporte con medidas de seguimiento comercial en Power BI
Integración de visualizaciones de productos de mayor venta y ganancia
You don't have access to this class
Keep learning! Join and start boosting your career
When leading a data analysis, one of the first questions that arises is to quantify the transactions within the data model. To address this task, we employ fundamental metrics with DAX, a powerful data expression language in Power BI. Learning how to handle these functions will allow you to quickly answer key operational questions and optimize the tracking of business metrics.
Let's start with the number of transactions, a basic but essential indicator. To calculate it, you build a measure that counts the rows of the sales table.
Number of transactions = COUNTROWS('Sales')
It is important to adjust the display format. By removing the units display and showing the exact number, you can see that there are, for example, 14,202 transactions, instead of a rounded 14,000.
Another key metric is the number of customers. Although we can use a basic counting function, it is crucial to apply business logic that allows us to get a unique customer count.
Number of customers = DISTINCTCOUNT('Customers'[Customer ID])
Counting a dimension, such as customer IDs from the customer table, ensures that you get the correct number of distinct customers, for example, 1,179. However, if you count the 'Customer' column in the sales table, you could get an erroneously high number due to multiple purchases by a single customer.
To explore sales by year and summary measures, it is essential to create visual tables that show key data such as total sum of sales and average sales.
Average Sales = AVERAGE('Sales'[Sales Price Excluding VAT])
At this point, each sales measure is made up of different DAX functions that allow:
DAX offers a wide repertoire for data analysis. Among the most commonly used mathematical functions are:
These functions are essential to calculate statistics such as minimum and maximum values or to perform mathematical base operations on business indicators. Using DAX properly turns data aggregations into an efficient task, enhancing the tracking and analysis of crucial metrics.
Learning DAX is a must for any analyst looking to hone their skills in Power BI or any other platform that uses this language. Microsoft's official documentation is an excellent resource to delve deeper into the use and applications of DAX, including advanced examples and best practices - keep exploring and don't stop learning!
Contributions 11
Questions 1
NO ES LO MISMO contar (COUNT) de la tabla Dim_Cliente que de la tabla Fact_Ventas.
Si se me ocurre contar (COUNT) desde la tabla Fact_Ventas sobre el campo Cliente, lo que voy a contar son las ventas en las que se registró el cliente. En nuestro caso en todas las ventas se cargó el cliente.
LO CORRECTO es contar en la tabla Dim_Clientes (COUNT or COUNTROWS).
ATENCIÓN: si llegamos a CONTAR DISTINTO sobre la tabla Fact_Ventas, dará la misma cantidad de clientes SI Y SOLO SI cada cliente compró al menos una vez. Ésta medida respendorá a pregunta ¿Cantidad de clientes que compraron al menos una vez? PERO no responde a la pregunta ¿Cantidad de clientes?
Resumen de la clase:
Operación:
Conteo:
Simple (count)
Distintivo (distinctcount)
Contar filas (countrows)
Estadísticos:
Min
Max
División (divide)
“Las funciones DAX te permitirán optimizar la creación de indicadores para el correcto seguimiento del negocio”.
Conclusión: es mucho mejor crear medidas que columnas
Genial, ya le estoy agarrando la onda a esto de power bi, gracias profe 😄
Want to see more contributions, questions and answers from the community?