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
Anonymous
Not applicable

Pivot DAX Column or Help with Matrix

Hi,

 

I have a table of Leads that basically has this structure:

CategoryCompany
ACom1
ACom1
BCom2
ACom5
BCom1
CCom2
CCom4
ACom3
BCom1

My actual table is much more complicated and the Category column is a DAX calculated column.

I need to be able to make a visual, either a table or a matrix, that looks like this:

ABC
Com1Com2Com2
Com1Com1Com4
Com5Com1 
Com3  

So you can see each catgory along the top and a list of companies below that fall into each one. I tried setting up a matrix to do this, but couldn't get it to work. 

I also wanted to unpivot to make this work, but the DAX calculated column can't be manipulted in Power Query. Any suggestions?

 

Thanks

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

What I can come out is to create three calculate tables like pattern below and create three table visuals though the duplicate values will be removed.

NewTableA = SELECTCOLUMNS(FILTER('Table', 'Table'[Category] = "A"), "A", 'Table'[Company])   

NewTableB = SELECTCOLUMNS(FILTER('Table', 'Table'[Category] = "B"), "B", 'Table'[Company])     

NewTableC = SELECTCOLUMNS(FILTER('Table', 'Table'[Category] = "C"), "C", 'Table'[Company])      

Capture.PNG  

2.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

What I can come out is to create three calculate tables like pattern below and create three table visuals though the duplicate values will be removed.

NewTableA = SELECTCOLUMNS(FILTER('Table', 'Table'[Category] = "A"), "A", 'Table'[Company])   

NewTableB = SELECTCOLUMNS(FILTER('Table', 'Table'[Category] = "B"), "B", 'Table'[Company])     

NewTableC = SELECTCOLUMNS(FILTER('Table', 'Table'[Category] = "C"), "C", 'Table'[Company])      

Capture.PNG  

2.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@Anonymous in matrix visual, put the category on columns and company on values, and you will get the same output.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

hi @parry2k 

 

Thank you for the help!

 

Unfortunately if you put a company name on values then you have to pick a summary, like First. I need them to show up as a list of companies under each category.

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.