Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Experts
See image below of end result, the current measure is off by one row, ie. the end result needs to shift up one. all the values are correct be in the wrong position (move up one)
Image
Measure
The measure was done by another User on the forum. But i cannot work out what to change in order to shift up one position the end result.
Measure =
var _currPeriod = max('Sample'[MonthKey])
var _last6 = topn(6, Filter(ALL('Sample'[MonthKey]), 'Sample'[MonthKey] < _currPeriod), 'Sample'[MonthKey])
var _last6Cnt = COUNTROWS(_last6)
var _numerator = CALCULATE(SUMX( 'Sample', 'Sample'[Amount] * 'Sample'[Rate]), _last6, all('Sample'))
var _denominator = CALCULATE(sum('Sample'[Amount]), _last6, all('Sample'))
return if(_last6Cnt >= 6, DIVIDE( _numerator , _denominator))
Solved! Go to Solution.
@Anonymous , is month key a date or number . I think you move back month like
var _currPeriod = max('Sample'[MonthKey]) -1
or
var _currPeriod = eomonth(max('Sample'[MonthKey]),-1)
Hi @Anonymous
What is the specific value of Month Key ? What is the exact result you need in the end ?
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , is month key a date or number . I think you move back month like
var _currPeriod = max('Sample'[MonthKey]) -1
or
var _currPeriod = eomonth(max('Sample'[MonthKey]),-1)
Hi Amit not working....
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
78 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
84 | |
48 | |
48 | |
48 |