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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cómo obtener el % de todo, pero no el valor seleccionado

Hola

Estoy trabajando en un tablero, y hay un KPI en % que necesita visualizar el porcentaje de los clientes en general (todas las tiendas, pero no la tienda seleccionada).

Así que cuando selecciono una tienda, quiero ver el % de los otros que hacen contra la tienda que seleccioné. Esperaba que hay algo en DAX que se puede decir que la tienda seleccionada no debe ser calculado, pero sólo las tiendas que no se seleccionan.:

Tengo un DAX que consigue todas las tiendas con los clientes de este año VS prev año y allí obtengo un número:


% Clientes Todas las Tiendas (ex tienda seleccionada (actual Año VS PrevYear)

VAR _currentALL - CALCULATE([Customer],ALL('Shop'))
VAR _lastyearALL - CALCULATE([Customer PY DoW],ALL('Shop'))

devolución

DIVIDE(_currentALL -_lastyearALL), _lastyearALL, 0)

Overall Customer of All Shops (Ex Shop selected)Cliente general de todas las tiendas (Ex Tienda seleccionada)


¿Alguien puede ayudarme?

Gr, GG

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hola @KB_BI_GG,

¿Algo en la línea de esto tal vez?

% Customers All Shops (ex selected Shop) =
VAR SelectedVal = SELECTEDVALUE('Shop'[Customer])
VAR Remaining_ = CALCULATE([Customer],ALL('Shop') , 'Shop'[Customer] <> SelectedVal)
RETURN
DIVIDE(([Customer] -_Remaining), _Remaining, 0)


Br
J


Connect on LinkedIn

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Thx for the solution 🙂

Anonymous
Not applicable

Hola @v-jingzhang

He resuelto mi problema con la siguiente declaración:

Primero calculo el año actual del cliente:

Cliente (Prop-Country)

VAR SelectedProperty á SELECTEDVALUE('Shop'[Nombre de la tienda])
VAR Remaining_ - CALCULATE([Visitors],ALL('Shop'[Shop Name]),ALL('Country'[Country Name]))

devolución
Remaining_


En segundo lugar calculo el año anterior al cliente:

Cliente py (Prop-Country)
VAR Remaining_ - CALCULATE([Customer PY DoW],ALL('Shop'[Shop Name]),ALL('Country'[Country Name]))

devolución
Remaining_

Calcular:
% Visitantes todas las propiedades ?
VAR Remaining_ [Cliente (Prop-Country)]
VAR RemainingPrev_ [Customer py (Prop-Country)]

devolución
DIVIDE(Remaining_ - RemainingPrev_), RemainingPrev_, 0)


¿Es una buena manera o estoy haciendo mucho por ahora?
amitchandak
Super User
Super User

@KB_BI_GG ,¿Puede compartir datos de ejemplo y salida de ejemplo en formato de tabla? O una muestra de pbix después de eliminar datos confidenciales.

Anonymous
Not applicable

Bueno, eso no es fácil porque usa una conexión en vivo a un modelo tabular. ¿Lo quieres en el nivel de tabla?

Puedo intentar que sea un ejemplo, pero ¿entiendes el CASO?

Greetz.

tex628
Community Champion
Community Champion

Hola @KB_BI_GG,

¿Algo en la línea de esto tal vez?

% Customers All Shops (ex selected Shop) =
VAR SelectedVal = SELECTEDVALUE('Shop'[Customer])
VAR Remaining_ = CALCULATE([Customer],ALL('Shop') , 'Shop'[Customer] <> SelectedVal)
RETURN
DIVIDE(([Customer] -_Remaining), _Remaining, 0)


Br
J


Connect on LinkedIn
Anonymous
Not applicable

Hola J,

He intentado que seas una solución y consigas algunos cambios en los valores. Pero no estoy seguro de si el cálculo es correcto. Tengo información de antecedentes:

El modelo es un STARMODEL (Dim_shops, Fact_CountCustomer). La columna im using es:

Dim_Shop(Property_Name)

Fact_CountCustomer(Clientes)

Dim_date(Fecha)

Entre la tabla hay una relación:

Así que en el filtro <> está la tienda sólo el Property_Name.

'Shop'[Customer] <> SelectedVal

@KB_BI_GG

¿Se ha resuelto el problema? Si es así, puede aceptar la publicación adecuada como la solución o publicar su propia solución como solución para ayudar a otros miembros a encontrarla rápidamente. Gracias.

Saludos
Equipo de apoyo a la comunidad _ Jing Zhang

tex628
Community Champion
Community Champion

Si Property_Name es la columna que está cortando en ella debería tener este aspecto en su lugar:

% Customers All Shops (ex selected Shop) =
VAR SelectedVal = SELECTEDVALUE('Shop'[Property_Name])
VAR Remaining_ = CALCULATE([Customer],ALL('Shop') , 'Shop'[Property_Name] <> SelectedVal)
RETURN
DIVIDE(([Customer] -_Remaining), _Remaining, 0)

[Cliente] Debe devolver el valor de la tienda seleccionada.
_Remaining Debe devolver el valor para todas las demás tiendas.

Avísame cómo va.

/ J


Connect on LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.