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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello community!
I am trying to get my around to following: I am required to provide my organization with a weekly overview of stock availabilities., which is bascially an extension of another thread i found on this forum: Click
In Excel, this is a two-step approach.
In Excel this would look like this.
In PowerBI I managed to solve for the expected inventory per week (measure 'Projected Inventory'). In addition, I created a Help Measure which is, in a not so smart way, checking for each balance in the consecutive weeks
VAR Stock =
CALCULATE (
MAX ( Stock[Item] ),
FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= MAX ( 'Date'[Date] ))
VAR Week1
CALCULATE (
SUM ( Verkoop[Aantal] ),
FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) + 7)
RETURN
SWITCH(TRUE(),
Stock + Week1 < 0, "Yes",
etc.,"No")
Using the below, I am fulfilling the conditions set out by 1 through 3 above.
Net availability =
SWITCH(TRUE(),
[Help Measure]="Yes",0,
[Projected Inventory] <= 0, 0,
[Projected Inventory]<[Ending Balance],[Projected Inventory],
[Ending Balance])
I am wondering how I can make this more efficient and for that I am requesting your help. I think that my help measure in particular can be programmed a lot better (resulting in the outcome highlighted below in excel).
Looking forward to hearing from you!
https://drive.google.com/file/d/19A6EFPtDiSwjkc_MieBzPR5SqCoAjG4-/view?usp=sharing
Please note that the data included differs from the excel screencap above. The idea is the same though
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
18 | |
15 | |
7 | |
5 |