Forum Discussion
key_to
3 years agoAdvocate I
Convert measure to column
Hi, I created a measure that works fine for each individual row, but the total sum and total average by division are wrong. Therefor I need to convert the measure into the column. Therefore I nee...
- 3 years agoI have found a solution for my issue and posting it here in case somebody else comes accross similar issue as me.Adjusted BaseSalary NOK column =VAR currentRowDate = 'PBI Compensation'[Date]VAR currentSalary = 'PBI Compensation'[BasePay in NOK]VAR previousSalary = LOOKUPVALUE('PBI Compensation'[BasePay in NOK], 'PBI Compensation'[SuccessFactor ID], 'PBI Compensation'[SuccessFactor ID], 'PBI Compensation'[Date], CALCULATE(MAX('PBI Compensation'[Date]), FILTER('PBI Compensation', 'PBI Compensation'[Date] < currentRowDate)))RETURN IF(ISBLANK(currentSalary), previousSalary, currentSalary)
amitchandak
3 years agoSuper User
key_to , Previous salary as new column
new COlumn =
var _max = maxx(filter( 'PBI Compensation', 'PBI Compensation'[Date] < earlier( 'PBI Compensation'[Date] )), 'PBI Compensation'[Date] )
return
Sumx(filter( 'PBI Compensation', 'PBI Compensation'[Date] = _max ), 'PBI Compensation'[Amount] )
Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s
key_to
3 years agoAdvocate I
I have found a solution for my issue and posting it here in case somebody else comes accross similar issue as me.
Adjusted BaseSalary NOK column =
VAR currentRowDate = 'PBI Compensation'[Date]
VAR currentSalary = 'PBI Compensation'[BasePay in NOK]
VAR previousSalary = LOOKUPVALUE('PBI Compensation'[BasePay in NOK], 'PBI Compensation'[SuccessFactor ID], 'PBI Compensation'[SuccessFactor ID], 'PBI Compensation'[Date], CALCULATE(MAX('PBI Compensation'[Date]), FILTER('PBI Compensation', 'PBI Compensation'[Date] < currentRowDate)))
RETURN IF(ISBLANK(currentSalary), previousSalary, currentSalary)