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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bignadad
Helper I
Helper I

Need to show weekly changes to values that are not stored

I have the following manual entry excel report I am trying to build in Power BI

bignadad_0-1706709221447.png

 

I'm going to use the "A Items No Stock" as my example.

I am using a DAX Calculate Count on itemNo but one of the filters is "inventory = 0"
That is pulling from the inventory level on the item card.

 

That is a calculated field that changes dynamically and has no date associated with it.

 

The data is coming from Business Central SaaS through a premium dataflow.

 

Two other examples are associated with Purchase Header and Purchase Line

bignadad_1-1706709487653.png

Here is my DAX for Unconfirmed PO

Unconfirmed PO = CALCULATE(COUNT(purchaseHeader[no]),purchaseHeader[completelyReceived]=FALSE(),purchaseHeader[confRcvdFromVendor]=FALSE(),purchaseHeader[documentDate]<TODAY()-7,purchaseHeader[documentType]="ORDER")
 
I cannot calculate that measure next week and get the same value because completelyReceived or confRcvdFromVendor can be true by then.
 
I google storing historical values and seems I have to setup an outside database to store these values each day because I know Power BI doesn't store data. 
I also thought about setting up a table in Business Central and have a Job Queue run weekly to populate these weekly values and then I can pull them out with my custom API. 
 
I just wanted to make sure I wasn't missing anything obvious that I could be doing in Power BI. This seems like such a logical and easy request and Im struggling with how hard it seems it will be.
2 REPLIES 2
bignadad
Helper I
Helper I

I need to look at prior weeks. So in the example i need this measure calculated for 1/26, 1/19, 1/12, etc.

 

Also if I filter completelyReceived for any date prior it could be received by then meaning completelyReceived = true. 

amitchandak
Super User
Super User

@bignadad , Join date(only date, no timestamp) of you table with date table 

 

This is normal measure

Unconfirmed PO = CALCULATE(COUNT(purchaseHeader[no]),Filter(purchaseHeader, purchaseHeader[completelyReceived]=FALSE() && purchaseHeader[confRcvdFromVendor]=FALSE() && purchaseHeader[documentType]="ORDER"))

After 7 days


Unconfirmed PO next week= CALCULATE(COUNT(purchaseHeader[no]),Filter(purchaseHeader, purchaseHeader[completelyReceived]=FALSE() && purchaseHeader[confRcvdFromVendor]=FALSE() && purchaseHeader[documentType]="ORDER"), dateadd(Date[Date], 7 , day))

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.