Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SK_
New Member

Calculate Storage Cost based on Date Range Selected

Hi, I'm trying to work out how much the storage cost would be over the next few weeks/months (based on a date range selected using a slicer) but seem to be getting mixed results with everything I've tried. 

 

I have a fixed price for weekly storage cost per pallet. I'm trying to make a calculated column and/or measure that will take that fixed weely storage cost and calcuate the cost over the coming weeks/months based on what the user selects. 

I have tried several different things like getting the number of weeks offset from my calendar table (based on last date selected in slicer return the number of weeks this is away from the first date) and then multiple the storage per week cost by that number, which should be correct but the result is not as expected. I end up with really high numbers.

 

Below is an example with the last column being the expected outcome.

Data Slicer (Slider)07/01/202404/02/20244 Weeks
    
SKUPallet QuantityWeekly Storage CostBased on Date Range Selected
Product 10.5£2.50£10.00
Product 21£5£20
Product 32£10£40

 

Any help would be much appreciated.

1 ACCEPTED SOLUTION
zenisekd
Super User
Super User

Create a measure that would work this way: 
COST BASED =  DISTINCTCOUNT ('DateRange'[weeks]) * SUM('Product'[Weekly storage])

View solution in original post

2 REPLIES 2
SK_
New Member

Thank you very much zenisekd, this is working as expected!

zenisekd
Super User
Super User

Create a measure that would work this way: 
COST BASED =  DISTINCTCOUNT ('DateRange'[weeks]) * SUM('Product'[Weekly storage])

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors