Forum Discussion
dannyboy123
2 years agoFrequent Visitor
Week on week values
Hi all. Fairly new to Power BI. I have a test set of data with 2 locations and data for 2 weeks. I would like to get the week on week difference by location, but leave it blank if there is no previ...
- 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! 🤠
Daniel29195
2 years agoCommunity Champion
Measur2 =
VAR cw = CALCULATE(SUM('Table'[success]),FILTER(all('Table'),'Table'[week]=MAX('Table'[week])))
VAR lw = CALCULATE(SUM('Table'[success]),FILTER(('Table'),'Table'[week]=MAX('Table'[week])-1))
RETURN IF(ISBLANK(lw), BLANK(), cw-lw)
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! 🤠
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠