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

El porcentaje de ventas no funciona correctamente

Hola a todos,

Mi columna % de ventas no se calcula correctamente ya que todos los números son positivos. Cualquier sugerencia es apreciada.

Gracias.

Ventas del año anteriorVentas del año en curso% de ventas
585749.19370309.781.177270912
221761.2167007.711.321801989
88842.8688607.083.159434982

El DAX que estoy usando

Ventas del año en curso =
CALCULAR(
SUMA('SEC rptRevenueAll_V'[Ventas brutas]),
FILTRO(
'SEC rptRevenueAll_V',
AÑO('SEC rptRevenueAll_V'[ActivityMonth]) = AÑO(HOY())
)
)
Ventas del año anterior =
CALCULAR(
SUMA('SEC rptRevenueAll_V'[Ventas brutas]),
FILTRO(
'SEC rptRevenueAll_V',
AÑO('SEC rptRevenueAll_V'[ActivityMonth]) = AÑO(HOY()) - 1
)
)
% de diferencia de ventas =
DIVIDIR(
[Ventas] - CALCULAR([Ventas], MISMO PERÍODOEL año pasado('SEC rptRevenueAll_V'[ActivityMonth])),
CALCULAR([Ventas], MISMO PERÍODOEL año pasado('SEC rptRevenueAll_V'[ActivityMonth]))
)
2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

¡Gracias! Eso funcionó. Agregué un poco más abajo para que fuera un número entero.

% de diferencia de ventas =
DÓNDE CurrentYearSales = [Ventas del año en curso]
DÓNDE AnteriorAñoVentas = [Ventas del año anterior]
DÓNDE Diferencia = CurrentYearSales - AnteriorAñoVentas
DEVOLUCIÓN
SI(
AnteriorAñoVentas = 0,
ESPACIO EN BLANCO(),
((Diferencia / AnteriorAñoVentas) * 100)
)
Syndicate_Admin
Administrator
Administrator

Sales % Difference = 
VAR CurrentYearSales = [Current Year Sales]
VAR PreviousYearSales = [Previous Year Sales]
VAR Difference = CurrentYearSales - PreviousYearSales
RETURN
IF(
    PreviousYearSales = 0,
    BLANK(),
    Difference / PreviousYearSales
)
//try this one might help you

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.