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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Cambiar el pronóstico de ventas DAX para productos individuales

Hay Expertos

Quiero modificar el siguiente DAX que me da un pronóstico de mis ventas basado en los últimos 3 años con un aumento del 5% en todos los productos.

Quiero agregar un paso adicional en el DAX donde los Productos (Servicios administrados, Servicio profesional) tienen un aumento del 7% y 8% en las ventas para 2022 y las ventas para todos los demás productos están en el 5%.

Pronóstico de ventas =

DÓNDE VENTAS = CALCULAR([Cambio total mensual],FECHAADD('Calendario'[Fecha],-1,AÑO))
DÓNDE VENTAS2LY = CALCULAR([Cambio total mensual],FECHAADD('Calendario'[Fecha],-2,AÑO))
DÓNDE VENTAS3LY = CALCULAR([Cambio total mensual],FECHAADD('Calendario'[Fecha],-3,AÑO))

Dónde Factor = 1.05
Devolución
DIVIDIR(VENTAS+VENTAS2LY+VENTAS3LY,3,0)*Factor
1 ACCEPTED SOLUTION

@Anonymous ,

Sales Forecast =
VAR SALESLY =
    CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -1, YEAR ) )
VAR SALES2LY =
    CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -2, YEAR ) )
VAR SALES3LY =
    CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -3, YEAR ) )
VAR Factor =
    SWITCH(
        TRUE(),
        MAX( Table[service] ) = "Managed Services", 1.07,
        MAX( Table[service] ) = "Professional Services", 1.08,
        1.05
    )
RETURN
    DIVIDE( SALESLY + SALES2LY + SALES3LY, 3, 0 ) * Factor

resultado:

vchenwuzmsft_0-1640238950985.png

Saludos

Equipo de apoyo a la comunidad _ chenwu zhu

Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Hola AMit aquí está el resultado final esperado

ServicioVentasResultado Levantamiento
Servicio gestionado11.07 0.07
Servicio Profesional22.16 0.08
Nuevo33.15 0.05
viejo44.2 0.05
Otro55.25 0.05
No solo la EM y la PS tienen un aumento de 7 y 8 (%)
Todo lo demás 5%

@Anonymous ,

Sales Forecast =
VAR SALESLY =
    CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -1, YEAR ) )
VAR SALES2LY =
    CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -2, YEAR ) )
VAR SALES3LY =
    CALCULATE( [Monthly Total Switch], DATEADD( 'Calendar'[Date], -3, YEAR ) )
VAR Factor =
    SWITCH(
        TRUE(),
        MAX( Table[service] ) = "Managed Services", 1.07,
        MAX( Table[service] ) = "Professional Services", 1.08,
        1.05
    )
RETURN
    DIVIDE( SALESLY + SALES2LY + SALES3LY, 3, 0 ) * Factor

resultado:

vchenwuzmsft_0-1640238950985.png

Saludos

Equipo de apoyo a la comunidad _ chenwu zhu

Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.

Syndicate_Admin
Administrator
Administrator

@Route111 , Pruebe una medida como

Factor Var = 1,05
Devolución

Sumx( Valores(Tabla[Producto]) ,
DIVIDE(SALESLY+SALES2LY+SALES3LY,3,0)*Switch( True() ,

max(Table[Product]) = "Servicios gestionados" , 1,07,

max(Tabla[Producto]) = "Servicio profesional" , 1.08,

1.05) )

Hola Amit - no obtener resultados de vuelta

Medida = Sumx( Valores(FACT_NEWBI_NewSalesDashboard[Tipo de orden]) ,
[Pronóstico de ventas]*Interruptor( Verdadero() ,

Máximo(FACT_NEWBI_NewSalesDashboard[Tipo de orden]) = "Servicios gestionados" , 1.07,

Máximo(FACT_NEWBI_NewSalesDashboard[Tipo de orden]) = "Servicios Profesionales" , 1.08,

1.05) )

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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