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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jamesbb93
New Member

Matrix table using multiple columns

Hi,

 

Seasons greetings to everyone!  I'm hoping someone could help me with something I feel is pretty complex, but it's probably a simple fix!

 

I have a power query table with the following data (snippet below and fuller example of dataset attached)

IDDateTotal Trg Hours TotalAvoiding Action ScoreScan ScoreDivision of Attention Score
5401/12/202101:45-200
5603/12/202102:0010 
5703/12/202102:300 -1

 

I would like to show a COUNT of the data in a matrix table in the following format.

 -2-101
Avoiding Action1010
Scan0020
Division of Attention0110

 

To give a better example of just what I'm looking for, see PDF link of the report the table will be going into. I've managed to recreate exactly what I'm looking for using a UNION table, but because there's no relationships, it's not filterable against the rest of the report (problem!!)

 

Really hope someone can help with this.

 

Thanks in advance and Happy New Year!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jamesbb93 , Unpivot the columns from F to AB in your excel in power query, then you have both headers and values as columns, you can use them in matrix as row and column and count of any one as values

 

https://radacad.com/pivot-and-unpivot-with-power-bi

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Result: =
CALCULATE (
COUNTROWS ( FILTER ( 'Table', 'Table'[Value] <> BLANK () ) ),
FILTER ( 'Table', 'Table'[Value] = MAX ( 'Table'[Value] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@jamesbb93 , Unpivot the columns from F to AB in your excel in power query, then you have both headers and values as columns, you can use them in matrix as row and column and count of any one as values

 

https://radacad.com/pivot-and-unpivot-with-power-bi

@amitchandak @Jihwan_Kim I wasn't expecting such quick replies.

I went with the Unpivot route as it worked better with my data model.

 

Really appreciate the help!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.