The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
77 | |
75 | |
36 | |
31 | |
28 |
User | Count |
---|---|
95 | |
81 | |
55 | |
48 | |
48 |