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
Power BI is a powerful tool that allows the creation of business management indicators in an efficient way. One of its best-kept secrets is the use of variables, which facilitate the simplification of complex formulas. Through Year over Year measures, the generation of indicators becomes not only more understandable but also more manageable. In the following, we will explore how to create these indicators using measures and variables.
The Year over Year (YOY) measure calculates the growth or decline of a specific variable or metric compared to the same period of the previous year. This indicator is essential for analyzing long-term trends in sales data.
Here's how to create the YOY in Power BI:
Creating a new measure:
Using variables:
VAR SalesLastYear = CALCULATE(TotalSales, DATEADD(DATE, -1, YEAR))
Year over Year calculation:
DIVIDE
function to avoid division by zero errors:RETURN DIVIDE(TotalSales - SalesLastYear, SalesLastYear, 0).
Differentiating the days of the week is essential for certain analyses, such as calculating the average sales over the weekend.
Creating a new column:
DimDates
dimension, right click and select "new column".DayName = FORMAT(DimDates[Date], "dddd").
Weekend identification:
VAR WeekEnd = FILTER(DimDates, DimDates[DayName] = "Saturday" || DimDates[DayName] = "Sunday").
Calculation of average sales:
AVERAGEX
function to calculate the average sales over the weekend:RETURN AVERAGEX(Weekend, Sales)
.The next logical step after implementing YOY is to calculate the quarterly change, known as Quarter over Quarter (QOQ). It works similarly to YOY but applies the comparison to the previous quarter.
New measures and variables:
DATEADD
function.Community Invitation:
So now you know, variables not only simplify measurements in Power BI but also make your data analysis more robust. We encourage you to keep exploring and sharing your findings to grow with the community.
Contributions 35
Questions 1
QoQ =
VAR VentasLQ =
CALCULATE ( [Total de Ventas], DATEADD ( Dim_Fechas[Date], -1, QUARTER ) )
RETURN
DIVIDE ( [Total de Ventas] - VentasLQ, VentasLQ, 0 )
QoQuarter = VAR Ventas_last_quarter = CALCULATE([Total ventas],DATEADD(Dim_Fechas[Date],-1,QUARTER)) RETURN DIVIDE([Total ventas] - Ventas_last_quarter,Ventas_last_quarter,0)
Want to see more contributions, questions and answers from the community?