Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
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
Solved! Go to Solution.
@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
Hi, @aji549
You can refer to @Greg_Deckler reply. If it doesn't meet your needs, you can refer to the following DAX.
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
Hi, @aji549
You can refer to @Greg_Deckler reply. If it doesn't meet your needs, you can refer to the following DAX.
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
@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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |