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
t-dahen
Employee
Employee

Porcentaje dentro de la categoría

Mis datos parecen

FechaNombreTotalCategoría
4/10Bob2A
4/10Alice6A
4/10Joe3B
4/11Bob7A
4/11Alice3A
4/11Joe8B

Me gustaría obtener esto:

FechaNombrePorcentaje en Categoría
4/10Bob33.3%
4/10Alice66.7%
4/10Joe100%
4/11Bob70%
4/11Alice30%
4/11Joe100%

Para cada día, averigua el porcentaje que representan para Total en su Categoría. Como Joe es el único en su categoría, obviamente tiene el 100% para todos los días. El 4/11, el Total de Alice representa el 70% de todo el Total para el grupo A.

Gracias

3 REPLIES 3
jdbuchanan71
Super User
Super User

@t-dahen

Pruébalo en esto.

% of total = 
VAR _Total = CALCULATE(
    SUM('Table'[Total]),ALLEXCEPT('Table','Table'[Date],'Table'[Category]))
RETURN DIVIDE(SUM('Table'[Total]),_Total)

jdbuchanan71_0-1593728714942.png

Esto funciona cuando hay contexto de clasificación. Me gustaría poder inferir la clasificación con el contexto de nombre justo.

% of total = 
VAR _Cats = VALUES('Table'[Category])
VAR _Total = CALCULATE(
    SUM('Table'[Total]),ALLEXCEPT('Table','Table'[Date]),_Cats)
RETURN DIVIDE(SUM('Table'[Total]),_Total)

jdbuchanan71_0-1593731723318.png

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.