Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 previous week
This is my data
This is what I have...
Thanks
Solved! Go to Solution.
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! 🤠
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! 🤠
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
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! 🤠
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |