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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
francescjp
Regular Visitor

Sum values with condition from diferent tables

Hello:

 

I have 12 tables, each for one month. Here you have an example of two months. In the first column I have name and surname of each person. In following columns, I have different concepts that have earned all the days in the month. There was an additional day row that has been hidden. This is the reason because concepts are repeated en each month. Each one was earned in different day.

I need to sum the total of year of each concept per person. The conpcets can be different in each month. Anyobody knows how to calculate it?

 

Thanks in advance.

 

An example:

 

The desired result:

Year

 Junta Govern LocalComissió Interàrees
Person 1XXXYYY
Person 2ZZZZKKKK

 

Data I have:

 

January

 Junta Govern LocalComissió InteràreesComissió InteràreesConsell Escolar MpalJunta Govern LocalComissió InteràreesComissió Informativa PJunta de PortaveusComissió InteràreesConsell Comerç i ConsumJunta Govern Local EPle
Person161.48ABSENTABSENTnull61.48ABSENT112.7null175.24null61.48276.62
Person2null175.24175.24nullnull175.24112.7null175.24112.7null276.62
Person361.48175.24175.24null61.48175.24112.7null175.24null61.48276.62
Person461.48ABSENT175.24112.761.48ABSENTABSENT61.48175.24null61.48276.62
Person5null175.24175.24nullnull175.24112.7null175.24nullnull276.62
Person6nullnullnullnullnullnull112.761.48nullnullnull276.62
Person7nullnullnullnullnullnull112.7nullnullnullnull276.62
Person8nullnullnullnullnullnull112.7nullnullnullnull276.62
Person9nullnullnull112.7nullnull112.7nullnull112.7null276.62
Person10nullnullnullnullnullnull112.7nullnullnullnull276.62
Person1161.48175.24175.24112.761.48175.24112.761.48175.24nullABSENT276.62
Person12null175.24175.24nullnull175.24112.7null175.24112.7null276.62
Person13nullnullnullnullnullnull112.7nullnullnullnull276.62
Person14nullnullnull112.7nullnull112.761.48null112.7null276.62
Person15nullnullnull112.7nullnull112.761.48null112.7null276.62

 

 

February

Cognoms i nomJunta Govern LocalComissió InteràreesComissió InteràreesJunta Govern LocalComissió Informativa PComissió InteràreesJunta de PortaveusPleComissió Interàrees
Person161.48175.24175.2461.48112.7175.24null276.62175.24
Person2null175.24175.24null112.7175.24null276.62175.24
Person361.48175.24175.2461.48112.7175.24null276.62175.24
Person1561.48175.24175.2461.48112.7175.2461.48276.62175.24
Person18null175.24175.24null112.7175.24null276.62175.24
Person19nullnullnullnull112.7nullABSENT276.62null
Person20nullnullnullnull112.7nullnull276.62null
Person5nullnullnullnull112.7nullnull276.62null
Person6nullnullnullnull112.7nullnull276.62null
Person7nullnullnullnullABSENTnullnull276.62null
Person861.48175.24175.2461.48112.7175.2461.48276.62175.24
Person9null175.24175.24null112.7175.24null276.62175.24
Person10nullnullnullnull112.7nullnull276.62null
Person11nullnullnullnull112.7null61.48276.62null
Person12nullnullnullnull112.7null61.48276.62null
1 REPLY 1
Daniel29195
Super User
Super User

Hello  @francescjp ,

i would suggest at first to unpivot the 12 tables : 

example  of unpivoting a table : 

Daniel29195_0-1705072914316.png

 

 

after unpivoting : 

Daniel29195_1-1705072938523.png

 

 

 

after you unpivot all tables, the next step is to append tables  ( use append query in the power query ) . 

 

 

third step : 

create a matrix with concept on the columns and person on the rows  and aggregation on values .

 

hope this helps

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.