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

How to use SUMMARIZE inside a calculated column?

I'm trying to get information from aggregated version of my table into my original table as a column, but im not sure how to do it.
Find the sample ecxample below

aji549_1-1718796834370.png

 

The table contains 4 column - EMP_ID, DATE, MONTHLY SALARY, DESIGNATION
I want to create new column called TOTAL SALARY which is the sum of salary for each employee available in data.
There is time filter as well, like if I select 6 months in the filter visual the total salary should be populated as total six months salary.
I couldn't find a way to do it in PBI using DAX/POWER QUERY.
Please help me on this!!


Thanks

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@aji549 Not sure I am following this. Calculated columns cannot be affected by filters so you would need a measure in that case. As a measure, you could potentially do something like this:

Measure =
  VAR __Emp = MAX('Table'[EMP_ID])
  VAR __Result = SUMX( FILTER( ALLSELECTED( 'Table' ), [EMP_ID} = __Emp ), [SALARY] )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Anonymous
Not applicable

Hi, @aji549 

You can refer to @Greg_Deckler reply. If it doesn't meet your needs, you can refer to the following DAX.

vyaningymsft_0-1718864574184.png

Total SALARY = CALCULATE(
    SUM('Table'[SALARY]),
    FILTER(
        'Table',
        'Table'[EMP_ID] = EARLIER('Table'[EMP_ID])
    )
)

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @aji549 

You can refer to @Greg_Deckler reply. If it doesn't meet your needs, you can refer to the following DAX.

vyaningymsft_0-1718864574184.png

Total SALARY = CALCULATE(
    SUM('Table'[SALARY]),
    FILTER(
        'Table',
        'Table'[EMP_ID] = EARLIER('Table'[EMP_ID])
    )
)

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Greg_Deckler
Community Champion
Community Champion

@aji549 Not sure I am following this. Calculated columns cannot be affected by filters so you would need a measure in that case. As a measure, you could potentially do something like this:

Measure =
  VAR __Emp = MAX('Table'[EMP_ID])
  VAR __Result = SUMX( FILTER( ALLSELECTED( 'Table' ), [EMP_ID} = __Emp ), [SALARY] )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

Users online (2,325)