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

Contar el número de veces que una palabra aparece en una tabla combinada

Hola a todos

Obtuve los datos de Gland de una tabla llamada hoja de datos y el resto de los datos de una tabla llamada programación de cable y formé una relación con su identificación. Me gustaría obtener el número de veces que el prensacables aparece la tabla combinada a continuación.

Eg. A240L 5

CW40L 3

Capture.JPG

¿Cómo puedo hacer eso?

Gracias.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@amelynatwork - Si entiendo correctamente, usted quiere MC Aggregations - https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

Para elaborar, estoy pensando algo como:

Measure =
  VAR __Gland = MAX('Table'[Gland]) //get the current value of the thing you are trying to find
  VAR __Table = 
    UNION(
      SELECTCOLUMNS(ALL('Table'),"Column",[Gland]),
      SELECTCOLUMNS(ALL('Table'),"Column",[Gland 2])
    )
RETURN
  COUNTROWS(FILTER(__Table,[Column] = __Gland))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Greg_Deckler

Disculpas, sé que ya lo he marcado como una solución, pero no puedo hacerlo bien.

Lo intenté

VAR tmpCol1 - SELECTCOLUMNS(Datasheet,"Column",[Gland])

VAR tmpCol2 - SELECTCOLUMNS('Cable Schedule',"Column",[ID])

VAR tmpTable - UNION(tmpCol1,tmpCol2)

VAR tmpValue á COUNTX(tmpTable,[Column])

(esto no me da los valores correctos)

Y

VAR Gland ('Hoja de datos'[ID]) //obtener el valor actual de lo que está tratando de encontrar
Tabla de VAR (VAR Table)
UNION(
SELECTCOLUMNS(ALL('Cable Schedule'),"Column",[ID]),
SELECTCOLUMNS(ALL('Hoja de datos'),"Columna",[Gland])
)
devolución
COUNTROWS(FILTER(Table,[Column] á Gland))
Aunque esto simplemente no funciona con el mensaje de error 'sintaxis para la tabla es incorrecta' y 'no puede encontrar el nombre 'ID'
Capture.JPG
También he incluido mi ventana de campo.
Agradecemos su ayuda
Greg_Deckler
Super User
Super User

@amelynatwork - Si entiendo correctamente, usted quiere MC Aggregations - https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

Para elaborar, estoy pensando algo como:

Measure =
  VAR __Gland = MAX('Table'[Gland]) //get the current value of the thing you are trying to find
  VAR __Table = 
    UNION(
      SELECTCOLUMNS(ALL('Table'),"Column",[Gland]),
      SELECTCOLUMNS(ALL('Table'),"Column",[Gland 2])
    )
RETURN
  COUNTROWS(FILTER(__Table,[Column] = __Gland))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler

MC Max - 
VAR tmpCol1 - SELECTCOLUMNS(Data,"Column",[Value1])
VAR tmpCol2 á SELECTCOLUMNS(Data,"Column",[Value2])
VAR tmpCol3 - SELECTCOLUMNS(Data,"Column",[Value3])
VAR tmpCol4 - SELECTCOLUMNS(Data,"Column",[Value4])
VAR tmpTable ? UNION(UNION(UNION(tmpCol1,tmpCol2),tmpCol3),tmpCol4)
VAR tmpValue ? MAXX(tmpTable,[Column])
RETURN tmpValue

¿Cuál es la [Columna] en la última fila del DAX que se supone que es?

No puedo encontrar un valor para que me quede bien.

Gracias

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.