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! Learn more

Reply
ebrownretail
Resolver I
Resolver I

calculation not working

Hi!

I am trying to pull what my next week forecast is, but the measure is not pulling through any information. Any ideas? As you can see in the screen shot it is summing but not filling in the rows. The sum is correct.

 

Sales Forecast =
(CALCULATE(SUM('Walmart Projection'[Unit Forecast]),
FILTER('Walmart Projection', 'Walmart Projection'[Walmart Week] =
CALCULATE(MAX(Dates[Walmart Week]),FILTER(Dates,Dates[Date] = TODAY())))))
ebrownretail_0-1723662042146.png

 


 

1 ACCEPTED SOLUTION

i couldnt get the file to open so that was why i was asking, but i just figured it out. Its because the porgram didnt like i had multiple many to many relationships to the dates table for the walmart week. I changed the one going to my past sales history to a single instead of both relationship and it works and keeps everything else working as well. 

View solution in original post

10 REPLIES 10
mostho
Helper II
Helper II

@ebrownretail 

Do 'Walmart Projection'[Walmart Week] and Dates[Walmart Week] have the same type? I tried to reconstruct your example and it worked fine.

But at the end i guess you should tell us a little bit more about your data model.

 

Hi!

Yes they are the same. Below are the tables i am using to input the information into Power BI. 

relationships - 

  • Dates Table Walmart Week to Projections Walmart Week
  • DC List Regional DC number to Projection Regional DC number
  • DC List Regional DC number to DC Inv Regional DC number

I use a DC listing to get all the information by DC. as you can see below, it will sum the information, but not put it into each row. 

ebrownretail_1-1723729741907.png

 

The dates table is just an extended dates table with a walmart week included. 

ebrownretail_0-1723729649893.png

 

DC inventory

distribution_center_numberout_of_stock_case_quantity_this_yearwarehouse_packs_shipped_to_store_this_yearOHOO
60060000
60090000
60100000
60110000
60120010
60160000
601701120
60180000
60190000
60200000
60210010

 

Projections. 

Regional DCStore NumberWalmart WeekUnit Forecast
60941212024298
6068114820242919
702636202024294
60662622024292
6031445120242921
6036567320242913
609223392024291
703954382024293
6054443620242919
602721292024294
606668420242928
60545102024298
601633912024296
703520262024293
603028852024293
704528092024298
6048120420242916
703934342024293
6070106020242911
603832212024292
604852120242950
605469982024292
600937342024291

as i said i tried to reconstruct a minimal example and it worked.

measure.jpg

maybe you can see on my pbix some difference to yours.

Would you be able to paste the measure into the message? i can read it on the screenshot.

1. its the same as yours.
2. you can look in my pbix.

i couldnt get the file to open so that was why i was asking, but i just figured it out. Its because the porgram didnt like i had multiple many to many relationships to the dates table for the walmart week. I changed the one going to my past sales history to a single instead of both relationship and it works and keeps everything else working as well. 

MattAllington
Community Champion
Community Champion

I don't know what a 6 digit week is. If you want to successfully use Time Intelligence, there are many rules you must follow. There are different rules if you use a day level calendar and want to leverage in built time intelligence, and if you don't have a day level calendar, and want to write time based calculations. You have t shared any details about your calendar table or the way its joined, so I can't comment. You could read a couple of articles I wrote and I'm sure they will help you. 

https://exceleratorbi.com.au/dax-time-intelligence-beginners/

 

https://exceleratorbi.com.au/power-bi-calendar-tables/

 

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

the 6 digit week is a year week combination. So this week is 202429 for the Walmart Week. 

MattAllington
Community Champion
Community Champion

I can't be sure without seeing you data model, but I can tell you that there is a problem with your FILTER statement

 

FILTER(Dates,Dates[Date] = TODAY())))))

 

the first parameter Dates inside your filter is already filtered by your visual. It looks like it is the entire Date table, but in fact it is a filtered copy of your date table. The first thing to try is this

 

FILTER(ALL(Dates),Dates[Date] = TODAY())))))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thanks. I added that and it did not change the issue.

 

I have a dates table that has 6 digit weeks on them

I have a projections table with 6 digit weeks

 

I am trying to get the table to bring back what the next weeks projection is by DC based on the 6 digit week number. Does this help?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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