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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to group all the profit values of each year for each country?

Hi,

In this data, we have many tables that represent the profits for a real estate company which have many branches and agents in many countries.

I want to predict the profit value for next years based on the available historical data and some criteria like GDP, Crime index, Density, Urban, Unemployment rate, etc...

I think, at first, I need to create a table that includes: countries names, total profit, years and other criteria values.

The first issue that I faced is to group the years to show the total value of those profits per year in each country.

Please have a look at the screenshot 

Group the profit by year for each country.JPG

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Use a matrix visual rather than a table, and put the years into the column area.

View solution in original post

5 REPLIES 5
lbendlin
Super User
Super User

I only provided pseudo code as I don't know your data model.  Use CALCULATE() etc as needed.

lbendlin
Super User
Super User

Create a new measure that adds these values. Something like this:

 

Total Profit = sum(Rentalprofit) +sum(Salesprofit)

Anonymous
Not applicable

Thanks again Ibendlin,

I think your suggestion's measurement is to get the sum of (total profit) for all years together, as a new column. Unfortunately, it's not working as you can see from the below screenshot. I think that because we have 2 titles or references for each column, one for years and another one for the type of profits (rent or sale).

I hope I could get an idea of how to find the (total profit) for each year

 Screenshot_1.png 

 

Anonymous
Not applicable

Thank you so much Ibendlin,

Just one more thing please, Now I got 2 values for each year, the Rental and the Sale, as you can see attached screenshot. How to get only the total value for each year?

 

need 1 value represent rent and saleneed 1 value represent rent and sale

lbendlin
Super User
Super User

Use a matrix visual rather than a table, and put the years into the column area.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.