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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
amalsp_ha
Frequent Visitor

Crear tabla de resumen basada en filtros/slicers seleccionados

Hola a todos

Estoy tratando de crear una visualización basada en la cantidad y el valor de compra con datos cercanos a los que se dan a continuación. Pero la cantidad debe ser la suma de los productos comprados por un minorista para el período seleccionado. Estos productos pueden cambiar en los elementos seleccionados en el filtro. [Es decir, hay una lista desplegable basada en la segmentación de datos que el usuario puede seleccionar uno o más productos, mientras que el resumen (tabla u otro) debe crearse filtrado en función de esa selección sobre la marcha]

Eg. Tabla de origen

Fecha

InvoiceNo

Retailercode

Productcode

Cantidad

Valor

10/29/2020

1000

RTL0001

PROD-001

10

100

10/29/2020

1000

RTL0001

PROD-002

25

300

10/29/2020

1000

RTL0001

PROD-003

7

140

11/2/2020

1001

RTL0002

PROD-002

15

180

11/2/2020

1001

RTL0002

PROD-003

17

340

11/2/2020

1001

RTL0002

PROD-004

5

500

11/3/2020

1002

RTL0003

PROD-002

20

240

Filtros aplicados [de la lista desplegable basada en segmentación]

ProducrCode: PROD-002 & PROD-003

También se pueden seleccionar otros filtros como la fecha y el área del minorista.

Tabla de destino [Salida requerida]

RetailerCode

Cantidad

Valor

RTL0001

32

440

RTL0002

32

520

RTL0003

20

240

Gráfico de destino [Salida requerida]

amalsp_ha_0-1604989103691.png

Gracias

Amal

8 REPLIES 8
MR2018
Regular Visitor

Hola Amal!

Al final encontraste una solución para este caso?? Tengo el mismo problema y estoy tratando de ver soluciones.
-----------------------------------

Hi Amal!

Did you get a solution for this issue?? I have the same problem and I'm trying to get a solution.

Anonymous
Not applicable

Holaamalsp_ha,

Estos son los pasos que puede seguir:

1. Cree una columna calculada.

Quantity_new =
CALCULATE(SUM('Table'[Quantity]),ALLEXCEPT('Table','Table'[Date],'Table'[ProductCode]))
Value_new =
CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Date],'Table'[ProductCode]))

2. Resultado.

v-yangliu-msft_0-1605169557848.png

Puede descargar el archivo PBIX desde aquí.

Saludos

Liu Yang

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Hi Liu Yang,

 

What I require is the 20 and the 32 in the x axis and the total for 20 and 32 respectively shown by the bar.

 

Please check the drawing of the bar chart I posted earlier. 

 

Thanks

 

Amal

Anonymous
Not applicable

Holaamalsp_ha,

Estos son los pasos que puede seguir:

1. Crear medida.

Quantity_new =
CALCULATE(SUM('Table'[Quantity]))
Value_new = 
CALCULATE(SUM('Table'[Value]))

2. Resultado.

v-yangliu-msft_0-1605164998548.png

Puede descargar el archivo PBIX desde aquí.

Saludos

Liu Yang

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Hi,

 

Thanks for this, but I need to show this as a chart. The quantity has to go on the x axis and value to the y axis as I have shown in the chart I have given. As far as I know a measure cannot be added to an axis of a chart. 

 

amalsp_ha_1-1605165831665.png

Amal

Anonymous
Not applicable

Hola @amalsp_ha ,

Estos son los pasos que puede seguir:

1. Cree una tabla calculada.

Table 2 =
SUMMARIZE(
'Table','Table'[Retailercode],    
"Quantity",CALCULATE(SUM('Table'[Quantity]),FILTER('Table','Table'[ProductCode]="PROD-002" || 'Table'[ProductCode]="PROD-003")),
"Value",CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[ProductCode]="PROD-002" || 'Table'[ProductCode]="PROD-003")))

2. Resultado.

v-yangliu-msft_0-1605076384224.jpeg

v-yangliu-msft_1-1605076384232.jpeg

Puede descargar el archivo PBIX desde aquí.

Saludos

Liu Yang

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Hi Liu Yang,

 

Thank you for the reply and the solution, but my issue here is that the product codes are not fixed, these are to be selected from a slicer. Also there are other slicers like date, geography. So I cannot use fixed products in the table creation dax. Today it might be PROD-002 & PROD-003 tomorrow it might be PROD-001 & PROD-002. 

 

Hope you have got an idea about my requirment. My apologies if I was not clear in my earlier post.

 

Amal

HOLA Amal,

Simplemente verificando si tiene la solución para su problema. Tengo exactamente el mismo escenario para tratar y strugling para arreglar.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors