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
Anonymous
Not applicable

PowerBI - salary historic

Hello everyone

I have a problem that I am not able to solve, I need to show the employee's salary in a pipeline, but the salary adjustments only occur in some periods of the year. but it is necessary to show me the most recent to date of the filter.


In the month less than April 04/19 the value must be 2,674.08 until 07/01/17, then 2,633.04 until 08/17 etc.

 

HistoricoSalario.JPG

https://drive.google.com/drive/folders/1LbKVnWinpoOjT8Fi6KTSqOPdyi62Iywk?usp=sharing

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Fábio, 

 

I fail to see why the should be 2,674.08 until 07/01/17, there is an entry in the table at 1/4/2018 were the value is 2,633.04.

Also there are duplicate dates in the history table. Is that really the case, and if so, how do you want to deal with it. 

 

If it is not the case the following measure should give you your result:

 

r1 = 
var CurrentPeriod = max('Dcalendario'[Date])
return
sumx(topn(1, filter('Historico_salary', 'Historico_salary'[DTMUDANCA]<CurrentPeriod), 'Historico_salary'[DTMUDANCA].[Date],DESC ), 'Historico_salary'[SALARIO])

Jan 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Fábio, 

 

I fail to see why the should be 2,674.08 until 07/01/17, there is an entry in the table at 1/4/2018 were the value is 2,633.04.

Also there are duplicate dates in the history table. Is that really the case, and if so, how do you want to deal with it. 

 

If it is not the case the following measure should give you your result:

 

r1 = 
var CurrentPeriod = max('Dcalendario'[Date])
return
sumx(topn(1, filter('Historico_salary', 'Historico_salary'[DTMUDANCA]<CurrentPeriod), 'Historico_salary'[DTMUDANCA].[Date],DESC ), 'Historico_salary'[SALARIO])

Jan 

Anonymous
Not applicable

Thank you,

In the original data model I have the date and time in the column, so I will always return the most recent one.

Your measure met perfectly. Thanks.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.