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
ompowerbi
Helper I
Helper I

Creating a new row as the SUM of two rows for multiple measures

Hi,

 

Possibly a complicated query here. I have several tables, please see below for reference. I have created visuals that summarise information based on the "Country" column. These visuals are matrices, which combine measures and already existing columns in my tables. I have to use the "Switch values to rows" button on these matrices so that they are formatted correctly from a visual perspective.

For instance, in a matrix, I use the country column from the "Summaries" table as my column headers and have added "Sales" column from the "Sales" table.. There are also measures included, that use data from multiple different tables. All are added to the matrix visual as "values". Using "Switch values to rows" this comes out looking like a table, where I need the column headers to be countries. 

My question is, what is the easiest way to create an additional column in the matrix which would give me the sales from England + Wales for example?

Essentially I would want to create an additional row in the tables, or a column in the matrix, that maps all data from england and wales and adds the numeric information together. 

I understand I could do this by getting my summary information into power query, which is reasonably simple for already existing table columns such as "sales" and doing a sumif in there. Then by transposing the table, I could add the England and Wales rows to create a new row. However, my measures are reasonably complicated in some instances and this could be difficult using m code. Also, I feel that some relationships may start to break in places.

So, is there a way to add the specific "England" and "Wales" data together to create this additional information in my matrix? Please let me know if anything needs to be clarified and thank you!

Summaries:

CountryEmployeesFactories
England1004
Wales502
Scotland201

Sales:

CountryFactory IDManagerSales% Sales
EnglandE1Aliyah Morales17558Cars
WalesW1Aaron Small11486Vans
ScotlandS1Zaria Prince12015Toys
EnglandE2Aron English19033Cars
EnglandE3Kelly Sloan15089Cars
EnglandE4Ocean Stark10974Cars
WalesW2Kamilah Pearson14840Vans
EnglandE1Gunner Carlson18665Cars
WalesW1Kali Hodges17421Vans
ScotlandS1Alonzo Wilcox17307Toys
EnglandE2Ashlyn Wang10192Cars
EnglandE3Cohen Decker15698Cars
EnglandE4Aleena McKay13543Cars
WalesW2Joey Dickerson19840Vans
EnglandE1Opal Guerrero17862Cars
WalesW1Bryce Wade15712Vans
ScotlandS1Evie Palmer15824Toys
EnglandE2Theo Lawrence14129Cars
EnglandE3Lauren Graves13489Cars
EnglandE4Cesar Ryan14956Cars
WalesW2Morgan Welch19114Vans
5 REPLIES 5
ompowerbi
Helper I
Helper I

The question proposed is fictional and if I were to comprehensively describe the intricacies of the issue, it would require a significant amount of time. As previously mentioned, the dataset and its underlying structures are rather complex, and to facilitate the process, I attempted to simplify the matter to minimize the time and effort required from any kind user who is willing to offer their help. My intention was to seek suggestions and ideas, and I appreciate your recommendation of the "group by" method. A switch function is used to display different currencies for each country. Please let me know if you have any quick suggestions through your experience as a super user, preferably talking about POWER BI.

I can help you find a solution for your scenario, and that solution doesn't necessarily have to involve Power BI. Power BI is a tool, it is not always the best tool for a job.

 

You can help by spending the effort to provide meaningful and covering sample data.

 

I have no quick suggestions.

ompowerbi
Helper I
Helper I

Can't do that unfortunately as E and W figures are in different currencies. Just wondering if there was a relatively easy way to do this. Not sure where data is put in twice?

E and W figures are in different currencies.

that is not obvious from your sample data. Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

Create a Group field based on your Country column.

 

Placing the same data twice in a visual is a design red flag.

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