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
Jill_Mc
New Member

Create table with year and summary and employee ID

Hi Community,

 

I have employee data for multiple years, with employees duplicated across years that they have had a paper published.  I need to aggregate the data for each year for each employee and put the total in a column chart. We have to add up data for the previous 3 years and ignore any that are older than 2021.

 

Starting dataset:

Semantic model example:

Employee IDDepartmentYearPublicationsIncomeStudents
ABCDPhysics20203

$6000

1
EFGHArt20214$15004
ABCDPhysics202110$30007
QRSTMath20225$5002
ABCDPhysics20221$8002
UVWXHistory20234$30001

 

I would like to get a table out that

1. de-duplicates the Employee ID and

2. adds up their metrics for each included year

3. Gives me a total output for all included years

4. Doesn't give me anything older than 3 years ago

 

Example table out:

Employee IDDepartmentTotal Publications (last 3 years)Total Income (last 3 years)Total Students (last 3 years)
ABCDPhysics11$38009
EFGHArt4$15004
QRSTMath5$5002
UVWXHistory4$30001

 

I am new to Power BI and need some help with this, I am nearly finished my report, but this is a sticking point.

 

Thank you from Australia.

2 ACCEPTED SOLUTIONS
muhammad_786_1
Super User
Super User

Hi, 


You can use these measures to achieve your desired output.

 

TotalPublications = 
CALCULATE(
    SUM('Table'[Publications]),
    FILTER('Table', 'Table'[Year] >= 2021)
)
TotalIncome = 
CALCULATE(
    SUM('Table'[Income]),
    FILTER('Table', 'Table'[Year] >= 2021)
)
TotalStudents = 
CALCULATE(
    SUM('Table'[Students]),
    FILTER('Table', 'Table'[Year] >= 2021)
)

muhammad_786_1_0-1727326313800.png

Best Regards,
Muhammad Yousaf

 

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

 

LinkedIn

View solution in original post

VahidDM
Super User
Super User

Hi @Jill_Mc 

 

Add all columns inot a table and set aggeragation for each column, change their name and add Year to the filter section with >=2021, Output:

VahidDM_0-1727327541557.png

 

 

sample file attached for your reference

 

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

Appreciate your Kudos!! 

 

LinkedIn|Twitter|Blog |YouTube 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @Jill_Mc 

 

Add all columns inot a table and set aggeragation for each column, change their name and add Year to the filter section with >=2021, Output:

VahidDM_0-1727327541557.png

 

 

sample file attached for your reference

 

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

Appreciate your Kudos!! 

 

LinkedIn|Twitter|Blog |YouTube 

muhammad_786_1
Super User
Super User

Hi, 


You can use these measures to achieve your desired output.

 

TotalPublications = 
CALCULATE(
    SUM('Table'[Publications]),
    FILTER('Table', 'Table'[Year] >= 2021)
)
TotalIncome = 
CALCULATE(
    SUM('Table'[Income]),
    FILTER('Table', 'Table'[Year] >= 2021)
)
TotalStudents = 
CALCULATE(
    SUM('Table'[Students]),
    FILTER('Table', 'Table'[Year] >= 2021)
)

muhammad_786_1_0-1727326313800.png

Best Regards,
Muhammad Yousaf

 

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

 

LinkedIn

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.