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
GlitterL
Frequent Visitor

Multiple populated Matrix - for power bi desktop or report builder

Hey hey, 

 

I am new to PB, and I'm a bit stuck,

I have this data with different categories, see example below (as I cannot provide the real data due to privacy)

 

DateCategoryLinkColourData

May 2022

carcar_redred5
April 2020busbus_redred15
May 2022carcar_blueblue2
June 2021taxitaxi_redred1
June 2021carcar_redred7

 

I want each Category to populate its own matrix like below, with the header being the category:

{(Header) = Category} - Car

 RedBlue
May 202252
June 20217 

 

{(Header) = Category} - Bus

 RedBlue
April 202015 

 

{(Header) = Category} - Taxi

 RedBlue
June 20211 

 

Please assist me and indicate if this is possible, I need to create paginated reports and each category needs to be on a single page

1 ACCEPTED SOLUTION
jbwtp
Memorable Member
Memorable Member

Hi @GlitterL,

 

Something like this(uing Pivot Column on the Transform menu tab)?

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k2s1DUyUtJRSk4sgpDxRakpQBaENFWK1YlWciwo0jUyAHKTSoshJIoiQ4gqLEYl5ZSmgjRAKCOwMq/SPF0jQyC3JLEiE0qhGoeqDLvDzGGKUhWMDIgzDq4Sp4mxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Category = _t, Link = _t, Colour = _t, Data = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Category", type text}, {"Link", type text}, {"Colour", type text}, {"Data", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Colour]), "Colour", "Data", List.Sum),
    #"Filtered Rows" = Table.SelectRows(#"Pivoted Column", each ([Category] = "bus"))
in
    #"Filtered Rows"

 

Kind regards,

John

View solution in original post

1 REPLY 1
jbwtp
Memorable Member
Memorable Member

Hi @GlitterL,

 

Something like this(uing Pivot Column on the Transform menu tab)?

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k2s1DUyUtJRSk4sgpDxRakpQBaENFWK1YlWciwo0jUyAHKTSoshJIoiQ4gqLEYl5ZSmgjRAKCOwMq/SPF0jQyC3JLEiE0qhGoeqDLvDzGGKUhWMDIgzDq4Sp4mxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Category = _t, Link = _t, Colour = _t, Data = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Category", type text}, {"Link", type text}, {"Colour", type text}, {"Data", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Colour]), "Colour", "Data", List.Sum),
    #"Filtered Rows" = Table.SelectRows(#"Pivoted Column", each ([Category] = "bus"))
in
    #"Filtered Rows"

 

Kind regards,

John

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.

Top Solution Authors
Top Kudoed Authors