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
ViktorLehtonen
Regular Visitor

Measures taking a long time - need help to optimize

Greetings PowerBI community, 

This is my first post and I have been struggling with this for a while. I will post a lot of screenshots and try to explain the issue. 
So basically I need help to improve these measures to run faster. I do not understand what is making them so slow. Please help.


I basically have two measures that are running a bit slow according the performance analyzer. These measures are [Coverage weighted] and [Coverage numeric] 

  • Coverage numeric = DIVIDE(fmInvoiceSales[Active Customer Buy],[Active Customer])
  • Coverage weighted = DIVIDE(fmInvoiceSales[KFP SM Weighted Sales],fmInvoiceSales[KFP SM Every Sales])

These measures are simple DIVIDE's however its the 4 measures within these DIVIDES that are heavy. 

ViktorLehtonen_0-1694676276031.png

ViktorLehtonen_1-1694676672230.png

ViktorLehtonen_2-1694676890987.pngViktorLehtonen_3-1694676922822.pngViktorLehtonen_4-1694676946948.pngViktorLehtonen_5-1694676971179.png

 

 

One of the DAX Queries that is taking a long time looks like this. It runs particulary slow when using the slicer "Sales Region" which comes from the dmCustomer table.

 

// DAX Query
DEFINE
VAR __DS0FilterTable = 
TREATAS({"Horeca Sweden",
"North"}, 'dmCustomer'[Sales Region])
 
VAR __DS0FilterTable2 = 
TREATAS({"Senaste 52 veckor"}, 'Period Parameter'[Period])
 
VAR __DS0FilterTable3 = 
TREATAS({TRUE}, 'dmCustomer'[Active Store CRM])
 
VAR __DS0Core = 
SUMMARIZECOLUMNS(
'dmCustomer'[Sales Region],
__DS0FilterTable,
__DS0FilterTable2,
__DS0FilterTable3,
"Coverage_weighted", 'fmInvoiceSales'[Coverage weighted],
"Coverage_numeric", 'fmInvoiceSales'[Coverage numeric]
)
 
VAR __DS0PrimaryWindowed = 
TOPN(1001, __DS0Core, [Coverage_weighted], 0, 'dmCustomer'[Sales Region], 1)
 
EVALUATE
__DS0PrimaryWindowed
 
ORDER BY
[Coverage_weighted] DESC, 'dmCustomer'[Sales Region]

 



1 REPLY 1
lbendlin
Super User
Super User

Familiarize yourself with DAX Studio.

 

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.