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
Juliecal73
Helper III
Helper III

Measure Slow with Added Relationship

Hi,

I feel like I'm missing something fundamental in context here but I just can't figure out what.

I have the following schema with relationships going to a fact table USA Timelisting and a Calendar table.

Juliecal73_1-1612998078456.png

I am trying to do a simple Matrix visual that is made up of the following fields and measures with a Slicer for USA Accounts 

 

'USA Projects'[Project]

'USA Tasks'[Task]

#Hrs Pct Used
#Hrs Pct Used Duration
 
The measures are as follows
#Hrs Pct Used = DIVIDE( SUM( 'USA TimeListing'[Hours] ), SUM( 'USA Tasks'[TaskPlannedHours] ), 0 )
#Hrs Pct Used Duration = 
VAR varTaskStart = MIN('USA Tasks'[Task Planned Start])
VAR varTaskEnd = MAX('USA Tasks'[Task Planned Finish])
VAR varBillableHrsTotal = CALCULATE(SUM('@CalendarOne'[WorkHours]), FILTER( ALLSELECTED( '@CalendarOne'[Date] ), '@CalendarOne'[Date] <= varTaskEnd))
VAR varBillableHrsToDate = CALCULATE(SUM('@CalendarOne'[WorkHours]), FILTER( ALLSELECTED( '@CalendarOne'[Date] ), '@CalendarOne'[Date] <= MIN(TODAY(), varTaskEnd)))

RETURN
DIVIDE(varBillableHrsToDate, varBillableHrsTotal, 0)

Problem:

Scenario 1 combination of fields in the table give a fine performance

Scenario 1 FineScenario 1 FineScenario 1 Table FineScenario 1 Table FineScenario 1 PerformanceScenario 1 Performance

 

Scenario 2 combination of fields in the table give a fine performance

Scenario 2 FineScenario 2 FineScenario 2 Table FineScenario 2 Table FineScenario 2 PerformanceScenario 2 Performance

 

But when I try and put both Project and Task with the 2 measures, it takes super long. I think there are more iterations happening than are necessary.

Problem ScenarioProblem ScenarioProblem Scenario TableProblem Scenario TableProblem PerformanceProblem Performance

 

Any advice would be much appreciated, this is driving me crazy.

7 REPLIES 7
InTheDark
Frequent Visitor

@Juliecal73 Did you ever figure out how to fix this? I'm coming across the same thing. 

Juliecal73
Helper III
Helper III

Will CROSSFILTER help in this scenario?

mahoneypat
Employee
Employee

First thing I would try is to pull the 

MIN(TODAY(), varTaskEnd)

into a variable and use it in the FILTER.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks @mahoneypat . Yes, neater, but as expected did not make any difference to the performance.

PaulDBrown
Community Champion
Community Champion

@Juliecal73 

Can you provide a sample PBIX file (changing any confidential column headings if necessary)?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown 

Unfortunately it is a big file with other reports in it (haven't got around to seperating them out) so not really possible to provide.

@Juliecal73 

Ok, I'll let others try to work it out then. Good luck!





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.