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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Need help with DAX

New to Power BI and trying to solve a query. I have two tables and need a calculated value based on name and month

Table A                                                                                     

DateReviewerPreparerSummary
10-1-22PaulNancy3
10-12-22NancyJohn4
10-15-22PaulAdam2
10-9-22JohnPaul5

 

Here from Table A, need Sum of summary column from both Preparer and Reviewer. That is value of Paul will be 10(3+2+5) 

Nancy - 7, John - 9, Adam - 2

 

Table B

MonthNameGrade
OctPaul1
OctJohn2
OctPaul1

 

Final productivity will be sum of Table A and Table B

Paul = 10+(1+1)

John = 9 + 2 and so on for each name

2 REPLIES 2
v-yinliw-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try this method:

New a table:

Result = SELECTCOLUMNS('TableA',"Name",'TableA'[Preparer])

 Then in the tableA create a measure:

ResultA =
CALCULATE (
    SUM ( TableA[Summary] ),
    FILTER (
        'TableA',
        'TableA'[Reviewer] = SELECTEDVALUE ( Result[Name] )
            || 'TableA'[Preparer] = SELECTEDVALUE ( Result[Name] )
    )
)

In the tableB create a measure:

ResultB =
CALCULATE (
    SUM ( TableB[Grade] ),
    FILTER ( 'TableB', 'TableB'[Name] = SELECTEDVALUE ( Result[Name] ) )
)

In the result table, create a measure:

Result = [ResultA] + [ResultB]

The result is:

vyinliwmsft_0-1671515896272.png

 

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

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

 

 

Anonymous
Not applicable

Hi @v-yinliw-msft ,

 

Thanks for the solution. I have data for entire year and the result is displayed as sum of all months. I have created slicer for month and need the corresponding month's data. I have created date dimension table from Table A , Table B also has month column. Any suggestions?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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