Forum Discussion
Week on week values
- 2 years ago
output
Column = var w = 'Table'[week] var depot = 'Table'[depot] var ds = SELECTCOLUMNS( TOPN(1, FILTER( 'Table', 'Table'[depot] = depot && 'Table'[week] < w ),'Table'[week] ),'Table'[sucess]) var diff = 'Table'[sucess] - ds return IF(ISBLANK(ds) ,BLANK(),diff)let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠 - 2 years ago
between ), and 'Table'[success] , write : "@success"
the way i wrote it, doesnt work on older power bi version .
so you need to specify a column name when using selectcolumns .
let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
Hi. Still returns black table if week, depot and measur2 selected
output
Column =
var w = 'Table'[week]
var depot = 'Table'[depot]
var ds =
SELECTCOLUMNS(
TOPN(1,
FILTER(
'Table',
'Table'[depot] = depot && 'Table'[week] < w
),'Table'[week]
),'Table'[sucess])
var diff = 'Table'[sucess] - ds
return IF(ISBLANK(ds) ,BLANK(),diff)
let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
- dannyboy1232 years agoFrequent Visitor
Seems to work just fine, thank you.
It does show an error though...
It says paremeter is not correct type? Why is that?
Thanks again
- Daniel291952 years agoCommunity Champion
between ), and 'Table'[success] , write : "@success"
the way i wrote it, doesnt work on older power bi version .
so you need to specify a column name when using selectcolumns .
let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠- dannyboy1232 years agoFrequent Visitor
OK, great. If there was another level of complication, such as if each depot had a sub depot, let's say north and south, how much more difficult would that be? The success column is a percentage so I wouldn't just want to add up the respective rows and divide, it would need to be based on the total number of parcels eg