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
Jperoz
New Member

Dax Contar filas con condiciones

Buenas actualmente me encuentro aprendiendo mas sobre lo que es el lenguaje Dax y quisiera el apoyo en lo siguente:

 

tengo esta data y necesito saber cuantas veces ocurre un documento por empresa 

 

imagen 1.png

 

este seria el resultado que quiero:

imagen 2.png

 

 

1 ACCEPTED SOLUTION
Jperoz
New Member

Gracias lo solucione agrupando documentos:

 

=CALCULATE(COUNTROWS('Hoja De Insumos'),GROUPBY(Config,Config[T/Documento]))

View solution in original post

4 REPLIES 4
Jperoz
New Member

Gracias lo solucione agrupando documentos:

 

=CALCULATE(COUNTROWS('Hoja De Insumos'),GROUPBY(Config,Config[T/Documento]))

Greg_Deckler
Super User
Super User

Parece que podrías usar un objeto visual de matriz con Emperatriz en el Documento T/En las Filas y Emperatriz en las Columnas. Y luego tal vez poner Emperatriz en los Valores con una agregación Count. Si eso no funciona, consulte esta publicación sobre cómo obtener su respuesta rápida a su pregunta: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Las partes más importantes son:
1. Muestra datos como texto, utilice la herramienta de tabla en la barra de edición
2. Salida esperada a partir de datos de muestra
3. Explicación en palabras de cómo obtener de 1. a 2.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
nandukrishnavs
Super User
Super User

@Jperoz 

 

You can implement this using EditQuery.

 

CompanyDocument
CompanyAA
CompanyBA
CompanyBA
CompanyBB
CompanyBB
CompanyBB
CompanyBB
CompanyBB
CompanyAC
CompanyAC
CompanyAC
CompanyAC

 

Step 1. Create a duplicate of Document column.

Step 2. Pivot the Comapny column.

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLUjMq3RU0lFyVIrVgQs4ESXgRG0BkDucyRKIBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Company = _t, Document = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Company", type text}, {"Document", type text}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Document", "Document - Copy"),
    #"Pivoted Column" = Table.Pivot(#"Duplicated Column", List.Distinct(#"Duplicated Column"[Company]), "Company", "Document - Copy", List.Count)
in
    #"Pivoted Column"

 

Capture.JPG



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

@Jperoz 

 

Another option- Use Matrix visual.

Capture.JPG

CountVal = COUNT('Table'[Document])



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 


Regards,
Nandu Krishna

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