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
NZemel
Advocate I
Advocate I

Creating a Matrix format in the Query Editor

Hi,

 

Some Background:

I have to work on figuring out the movement of opportunities within our Salesforce along the sales stages setup in the system (negotiation, PO, Business Lost...). The thing is that some of these accounts have multiple opportunities running simaltaneously. I want a view in which I can see the stages and the total amount of money in each opportunity. The easy fix was creating a Matrix view in Salesforce and have tried to export this report to Power BI. The issue with that however is when I bring it into Power BI, it brings the whole list and takes it out of the Matrix setup I have in SF.

 

Below is what my data looks like in Power BI Query Editor:

  

issue.png

 

 

 What I need this to look like in Power BI taken from an Excel PivotTable:

issue 1.png

 

 

 

 

Questions:
1. Is there a way to bring it into Power BI in Matrix format?

1. Is there a way to build a Matrix in the Query Editor of Power BI?

2, Similar to Excel when you use PivotTables you can display "values" using "sum of amount", can this be done in Power BI?

 

1 ACCEPTED SOLUTION

You can use "GROUPBY" operation before doing pivoting to achieve waht you are looking for.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

5 REPLIES 5
v-haibl-msft
Employee
Employee

@NZemel

 

The solution provided by BhaveshPatel should be right, please try it and post back if you still have questions.

There is a Matrix visual in Power BI. We can shape and transform the data firstly in Query Editor and then drag the values into Matrix visual. In Query Editor, we can use Group By function to get sum of amount.

 

Best Regards,

Herbert

@v-haibl-msft@BhaveshPatel

 

In response to the answers given.

 

I did go back into the query editor in order to begin setting up the table. If you look at the first picture I posted, it was not setup in the matrix form which Bhavesh showed in his pictures. In order to mimic his format, I created a conditional column for each stage which brought the amount of money in each stage per opportunity. Once I did this I used a group by in order to bring the data together.

BhaveshPatel
Community Champion
Community Champion

You can use pivot columns feature to achieve the desired matrix format result. However, there is already a inbuilt matrix visualization in powerbi (next to the table visual) that can be used as well.

 

For the transformation in Query Editor, Select the stage column and choose pivot column. As shown in the screenshot, Values section should be amount and aggrgation must be SUM to achieve expected output.

 

PIVOTPIVOTOUTPUTOUTPUT

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

If account name was the same lets say there is "A" and the amount is 1000 in Value Validation and another time "A" and the amount 4000 in Value Validation how do you connect both of them?

 

or in the case where an account has one opportunity at Value Validation and another at Business Lost, how do you connect them?

You can use "GROUPBY" operation before doing pivoting to achieve waht you are looking for.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

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.