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
Matricola
Frequent Visitor

Ayuda necesaria

Hola a todos

Estoy tratando de recrear el siguiente gráfico de Excel creando un total, pero excluyendo la marca 5

¿Alguien tiene una idea de cómo ?

Picture2.jpg

Excl. Fuego 5Marca 1Marca 2Marca 3Marca 4Marca 5 Excl. Fuego 5Marca 1Marca 2Marca 3Marca 4Marca 5
1000100200300400500 24%20%25%23%25%33%
1100200200300400100 26%40%25%23%25%7%
1150100200450400600 27%20%25%35%25%39%
950100200250400333 23%20%25%19%25%22%

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Matricola

Aquí hay una manera de hacer esto.

1) Cree una tabla que muestre las categorías del eje X. Lo he llamado "Tabla de Categorías"Cat Table.JPG

El modelo se ve así. Observe cómo esta tabla de categorías no está relacionada en el modelo.

Model.JPG

2) Crear las medidas para la categoría "Excl, Marca 5"

Suma de valores que incluyen la marca 5

SUM excl B5 = CALCULATE([Sum of Values], FILTER('Dim Brand', 'Dim Brand'[Brand] <> "Brand 5"))​

% de Excl B5 por serie

% Excl. Brand 5 = 
VAR ExcSumTotal = CALCULATE([SUM excl B5], ALL('Dim Series'[Series]))
Return
DIVIDE([SUM excl B5], ExcSumTotal)

3) Crear las medidas para los valores de marca:

% per brand = 
Var BrandTotal = CALCULATE([Sum of Values], ALL('Dim Series'[Series]))
Return
DIVIDE([Sum of Values], BrandTotal)

4) Crear la medida para filtrar por marcas la tabla de categorías

% per Brand for chart = CALCULATE([% per brand], TREATAS(VALUES('Categories Table'[Brand]), 'Dim Brand'[Brand]))

5) Y finalmente la medida para incluir en el gráfico apilado visual:

Measure for visual = 
IF(SELECTEDVALUE('Categories Table'[Brand]) = "Excl. Brand 5", 
    [% Excl. Brand 5],  
        [% per Brand for chart])

Ahora cree el objeto visual usando la "Tabla de categorías" como eje X y agregue esta [Medida para visual] final

y obtienes esto:

Result.JPG

He incluido el archivo PBIX de muestra para su referencia





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@Matricola

Aquí hay una manera de hacer esto.

1) Cree una tabla que muestre las categorías del eje X. Lo he llamado "Tabla de Categorías"Cat Table.JPG

El modelo se ve así. Observe cómo esta tabla de categorías no está relacionada en el modelo.

Model.JPG

2) Crear las medidas para la categoría "Excl, Marca 5"

Suma de valores que incluyen la marca 5

SUM excl B5 = CALCULATE([Sum of Values], FILTER('Dim Brand', 'Dim Brand'[Brand] <> "Brand 5"))​

% de Excl B5 por serie

% Excl. Brand 5 = 
VAR ExcSumTotal = CALCULATE([SUM excl B5], ALL('Dim Series'[Series]))
Return
DIVIDE([SUM excl B5], ExcSumTotal)

3) Crear las medidas para los valores de marca:

% per brand = 
Var BrandTotal = CALCULATE([Sum of Values], ALL('Dim Series'[Series]))
Return
DIVIDE([Sum of Values], BrandTotal)

4) Crear la medida para filtrar por marcas la tabla de categorías

% per Brand for chart = CALCULATE([% per brand], TREATAS(VALUES('Categories Table'[Brand]), 'Dim Brand'[Brand]))

5) Y finalmente la medida para incluir en el gráfico apilado visual:

Measure for visual = 
IF(SELECTEDVALUE('Categories Table'[Brand]) = "Excl. Brand 5", 
    [% Excl. Brand 5],  
        [% per Brand for chart])

Ahora cree el objeto visual usando la "Tabla de categorías" como eje X y agregue esta [Medida para visual] final

y obtienes esto:

Result.JPG

He incluido el archivo PBIX de muestra para su referencia





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hola

Sí, esto está haciendo el truco

Gracias

amitchandak
Super User
Super User

@Matricola, despofen los datos. https://radacad.com/pivot-and-unpivot-with-power-bi

Puede crear un objeto visual 100% apilado. Eliminar la marca 5 usando el sclicer del filtro de nivel visual

o tener medida como

divide(Sum(Table[Value]), calculate(Sum(Table[Value]), all(Table))

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.