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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rygaard
Resolver I
Resolver I

Expectations for future (Start+End date and amount) how do i calculate expected income pr future day

Date table (6500 lines)

Sales lines table (2 mill lines, 65K lines that are offers)

 

In my Calender table i tried to make a sum pr day in a new Collumb.. but ran out of memory :

SalesThisDay = CALCULATE(SUM('Sales Line'[SL_Amount]),FILTER('Sales Header','Sales Header'[SH_PriceStartDate]< EARLIER(Calender[DateValue])),FILTER('Sales Header','Sales Header'[SH_PriceEndDate]>EARLIER(Calender[DateValue])),FILTER('Sales Line','Sales Line'[SL_Document_Type]=0))

 
(document_type=0 is sales offers only

 

I think i need a new table, but I really dont know what it sould inculde..

 

Excel example attached:2021-01-15 14_54_52-Mappe2 - Excel.png

 

 

2 REPLIES 2
Pragati11
Super User
Super User

Hi @Rygaard ,

Assuming there a relationship between following tables:

  1. Sales Header
  2. Sales Line
  3. Calendar

May be so many FILTER expressions are creating issues. Try something as below:

 

SalesThisDay =
CALCULATE(
SUM('Sales Line'[SL_Amount]),FILTER('Sales Header','Sales Header'[SH_PriceStartDate] < EARLIER(Calender[DateValue]) && 'Sales Header'[SH_PriceEndDate] > EARLIER(Calender[DateValue]) && RELATED('Sales Line'[SL_Document_Type]) = 0))
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@Rygaard , Are you distributing/copying data for each day, where is the future data?

 

if you just need to allocate of copy on all dates for the range

How to divide/distribute values between start date or end date or count days across months/days: https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

 

Attached file is new table approach

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.