cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
KiranGupta15
Frequent Visitor

Cuenta en otra columna

Hola a todos

Soy nuevo en pwer BI, por favor ayuda a continuación.

cuenta en una nueva columna basada en otras 2 columnas.

Agradezco su apoyo aquí.

ServidorRiskRankContar
Server1102
Server1102
Server1203
Server1203
Server1203
Server1501
Server1604
Server1604
Server1604
Server1604
Server251
Server2403
Server2302
Server2602
Server2302
Server2501
Server2403
Server2602
Server2403
2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@KiranGupta15 - Si entiendo correctamente:

Count = COUNTROWS(FILTER('Table',[Server]=EARLIER([Server])&&[Risk]=EARLIER([Risk])))

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-rzhou-msft
Community Support
Community Support

Hola @KiranGupta15

Si desea obtener el recuento en otra columna de Power Query y mantener el modelo de datos, puede probar mi manera.

Construyo una mesa como la tuya para hacerme una prueba.

4.png

Duplicar la tabla y agrupar, a continuación, combinar dos tablas.

Un paso para que consigas los recuentos.

1.png

A continuación, combine dos tablas por columna Sever.

2.png

Resultado:

3.png

M Query es como se muestra a continuación, puede copiar esto en el Editor avanzado.

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tKkstMlTSUTI0UIrVwStgRLqAKbqAGYUCRiBD0fgm6AqM0QUwjMBQYYougGEohhkgFbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Server = _t, RiskRank = _t]),
    #"Merged Queries" = Table.NestedJoin(Source, {"Server", "RiskRank"}, Table2, {"Server", "RiskRank"}, "Table2", JoinKind.LeftOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(#"Merged Queries", "Table2", {"Count"}, {"Table2.Count"})
in
    #"Expanded Table2"

Saludos

Rico Zhou

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

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hola @KiranGupta15

Si desea obtener el recuento en otra columna de Power Query y mantener el modelo de datos, puede probar mi manera.

Construyo una mesa como la tuya para hacerme una prueba.

4.png

Duplicar la tabla y agrupar, a continuación, combinar dos tablas.

Un paso para que consigas los recuentos.

1.png

A continuación, combine dos tablas por columna Sever.

2.png

Resultado:

3.png

M Query es como se muestra a continuación, puede copiar esto en el Editor avanzado.

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tKkstMlTSUTI0UIrVwStgRLqAKbqAGYUCRiBD0fgm6AqM0QUwjMBQYYougGEohhkgFbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Server = _t, RiskRank = _t]),
    #"Merged Queries" = Table.NestedJoin(Source, {"Server", "RiskRank"}, Table2, {"Server", "RiskRank"}, "Table2", JoinKind.LeftOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(#"Merged Queries", "Table2", {"Count"}, {"Table2.Count"})
in
    #"Expanded Table2"

Saludos

Rico Zhou

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

FrankAT
Community Champion
Community Champion

Hola @KiranGupta15

puede hacerlo con Power Query de la siguiente manera:

// Table
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk4tKkstMlTSUTI0UIrVwStgRLqAKbqAGYUCRiBD0fgm6AqM0QUwjMBQYYougGEohhkgFbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Server = _t, RiskRank = _t]),
    #"Inserted Merged Column" = Table.AddColumn(Source, "Merged", each Text.Combine({[Server], [RiskRank]}, ""), type text),
    #"Grouped Rows" = Table.Group(#"Inserted Merged Column", {"Merged"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
    #"Grouped Rows"

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

Greg_Deckler
Super User
Super User

@KiranGupta15 - Si entiendo correctamente:

Count = COUNTROWS(FILTER('Table',[Server]=EARLIER([Server])&&[Risk]=EARLIER([Risk])))

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors