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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Matrix Visual help

Hello Community  -  I am struggling getting the proper results in a Matrix visual.   There are two parts to my question: 

 

I have 10 different inspection criteria (being imported from an Excel table).   The format is basically this: 

 

Date of Inspection   Job #    Criteria 1    Criteria 2   Criteria 3   etc....

Jan 10 2021               769        P                 P                F  

Jan 10 2021               770        F                 P                P

Jan 11 2021               771        F                 P                P  

 

Replicating the table is of course as easy as dragging in the field names.   The 2 parts I need help with are:

1.  Creating a measure that sums up the P's and F's in each column   (P = pass, F = fail).   

2.  Displaying the results in a matrix table  (see my example below)

3.  Currently, if I use the measure below, and drag one of the criteria into the Columns area on a Matrix visual, I get this...which is not at all what I am looking for.   It is using the F and P as the column header...not the actual column name.   Again, see example below for my desired result.    Any help is very appreciated!

 

texmexdragon_1-1631294136284.png

 

Measure =


VAR _Criteria1 = COUNT(Query1[Correct labels are present and installed per work instructions ])
VAR _InspResult = CALCULATE(_Criteria1,Query1[Correct labels are present and installed per work instructions ] = "F")

RETURN
_InspResult
 
Here is what I would like to have the matrix visual look like:
            Criteria 1           Criteria 2      Criteria 3        Criteria  4     etc...  
Pass          4                          5                 11                   3
Fail           7                          6                   0                    8
 
Here is what a standard table looks like with two of the criteria.  This is fine.  
 
texmexdragon_0-1631293522906.png

 

 
 
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

What I usually do when I get this type of data from Excel is to bring it into usable form by unpivoting

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMUzA0UDAyMDI8tEABCSnpKMGY5maWKHyFACyK4CgAJux2aAGQGatDpCXmBqjmuRFlSQDCAkNCFhiSZQHEF7EA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date of Inspection   " = _t, #"Job #   " = _t, #"Criteria 1   " = _t, #"Criteria 2   " = _t, #"Criteria 3   " = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Date of Inspection   ", "Job #   "}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"

That is now in a format which Power BI likes and can use for computations

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

What I usually do when I get this type of data from Excel is to bring it into usable form by unpivoting

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMUzA0UDAyMDI8tEABCSnpKMGY5maWKHyFACyK4CgAJux2aAGQGatDpCXmBqjmuRFlSQDCAkNCFhiSZQHEF7EA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date of Inspection   " = _t, #"Job #   " = _t, #"Criteria 1   " = _t, #"Criteria 2   " = _t, #"Criteria 3   " = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Date of Inspection   ", "Job #   "}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"

That is now in a format which Power BI likes and can use for computations

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.