Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
I have a question on how to create a certain visual.
So I have data that looks like this,
And what I want to show is TOTAL ON HAND QTY as time passes... Basically subtract the on hand qty from the total after the ship date has passed.
So currently, it is 1208.
On March 1st, it should be 955.
My issue is that since everything is tied to ship date weekly bins, it wont show Total Qty each week, it just shows Total Qty for whatever products are being shipped.
How would I create a measure or column that will allow this?
Thanks!!!!
Solved! Go to Solution.
You may try the measure below.
Measure =
VAR w =
CALCULATE ( MAX ( 'Table'[Week] ), ALLSELECTED ( 'Table'[Item] ) )
VAR i =
SELECTEDVALUE ( 'Table'[Item] )
RETURN
SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Item] = i && 'Table'[Week] > w ),
'Table'[Qty]
)
You may try the measure below.
Measure =
VAR w =
CALCULATE ( MAX ( 'Table'[Week] ), ALLSELECTED ( 'Table'[Item] ) )
VAR i =
SELECTEDVALUE ( 'Table'[Item] )
RETURN
SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Item] = i && 'Table'[Week] > w ),
'Table'[Qty]
)
Hey @v-chuncz-msft
So in the code you created (beautifully done), we said as the Ship Date passes/goes in the past, subtract that on-hand qty amount from total amount (total amount = sum of all on hand).
We have since added more data and a new column that is Planned Start Date in order to have a more accurate view of "Current" on-hand total, since before we just assumed all of the On-Hand qty has already been made/we already have it.
Adding in the new data, we realized we were wrong, and we do Not currently have all of the "on-hand" inventory.
I was wondering (if possible) how I could adjust the code to say the following:
If Planned Start Date is in the past, Use as starting On-Hand qty (lets call it TOTAL qty)
If Planned Start Date is in the future, add on-hand qty to TOTAL qty
If Ship Date is in the past, subtract from TOTAL qty
please let me know if this is too big of an ask, or if you need more info to clarify! either way I really appreciate all of your help.
I tried to build on the example I originally posted to give more context but it might be more confusing idk lol!!!
https://drive.google.com/file/d/1e--PjJHbpJbuYFDvaU2c-NmMRicrf29o/view?usp=sharing
^google drive link for the excel file so you can see it better
Thank you!!!!
Ah! That worked perfectly!!!! Thank you so so much!
Post text data and it will make it easier to get you a 100% solution. I wrote a Days of Supply measure that seems to probably be along the lines of what you want. https://community.powerbi.com/t5/Quick-Measures-Gallery/Days-of-Supply/m-p/635656#M318
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.