Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Tabla de matriz de frecuencia

Hola PB Expertos,

Me he esforzado por crear una tabla, pero fallé.

Los datos se simplifican

image.png

Me gustaría hacer una tabla de matriz, no. de la visita se mostrará en la columna
Este es el resultado esperado:

image.png


Aquí está la descarga PBIX .

deseo que alguien puede ayudar, muchas gracias!

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hola @SimonChung_GGGG

Para su caso, simplemente cree una medida con lógica como se muestra a continuación:

Result = 
VAR _table =
    FILTER (
        CROSSJOIN (
            SUMMARIZE (
                'Table',
                'Table'[Royality],
                'Table'[Customer],
                "Totalsales", CALCULATE ( SUM ( 'Table'[Sales] ) ),
                "Frequency", CALCULATE ( COUNTA ( 'Table'[Customer] ) )
            ),
            Visit
        ),
        [Frequency] = [Value]
    )
RETURN
    SUMX ( _table, [Totalsales] )

Resultado:

3.JPG

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

¡Un millón de gracias! Esta pregunta me ha estado luchando durante unos días

BA_Pete
Super User
Super User

Hola @SimonChung_GGGG ,

Utilice este código para transformar primero los datos:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI0MACSxkqxOhC+ERrfGInvBFdvBOcbofGNkfjOYPUgAhvXBawbrtgFrBmFa0Is1xXIMgVxTcFcNxjXCM41QeUaQrmxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer = _t, Sales = _t, Royality = _t]),
    chgSalesType = Table.TransformColumnTypes(Source,{{"Sales", Int64.Type}}),
    #"groupRows&Count" = Table.Group(chgSalesType, {"Customer", "Royality"}, {{"sales", each List.Sum([Sales]), type number}, {"visits", each Table.RowCount(_), Int64.Type}}),
    chgVisitsType = Table.TransformColumnTypes(#"groupRows&Count",{{"visits", type text}})
in
    chgVisitsType

En Power Query, vaya a Nuevo origen > Consulta en blanco y, a continuación, en Editor avanzado, pegue mi código sobre el código predeterminado.

A continuación, en la vista de informe, configure la matriz de la siguiente manera:

SimonChung.PNG



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




amitchandak
Super User
Super User

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors