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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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