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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
simplimitch
Regular Visitor

Calculate with filter causing performance issues

Currently I am trying to do some calculations within Power BI and all of the component parts are working but when i put them together the system tells me that I don't have sufficient RAM.

 

I have tracked it back to a single part of the calculation but i can't figure a way to do it more efficiently.

 

CashflowCount = CALCULATE(COUNTROWS('Calendar'),filter(All('Calendar'),'Calendar'[Date] >= MIN(Cashflow[Task.StartDate]) && 'Calendar'[Date] <= MAX(Cashflow[Projects.EndDate])))

This is the calculation which is causing the problem which by itself does resolve after some time.

 

What i am trying to do is split the interest for a particular caulcation across the period taht the interest will be paid rather than just a total interest in the period it started to be accrued.

 

Any ideas?  I am assuming taht i'm not the only person who has had this problem and i might be missing somehting simple that will solve my problem.

1 ACCEPTED SOLUTION
dkay84_PowerBI
Microsoft Employee
Microsoft Employee

Will you have 1 row per day? In other words you are trying to calculate the number of days between a start date and end date?

Have you tried the DATEDIFF function? If this won't work, you could try calculating the min and max dates as there own measures and then using those in the calculate function.

View solution in original post

2 REPLIES 2
dkay84_PowerBI
Microsoft Employee
Microsoft Employee

Will you have 1 row per day? In other words you are trying to calculate the number of days between a start date and end date?

Have you tried the DATEDIFF function? If this won't work, you could try calculating the min and max dates as there own measures and then using those in the calculate function.

Yp DateDiff was a much better way of doing it.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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