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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Slow DAX measure

Hi Experts

I have the following measure which works out the p value and tau value for each row in my fact table which has 250000 row in it..

Both the p value and tau value are measures themselves is there any way I could speed up my run time which is current 2 minutes PBI Services and 42 sec desktop.

Downward =CALCULATE ( COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] ),FILTER (ALLSELECTED ('PMS_FINANCIAL_PDS'[ROLL12_COMPLETE_PDS_IND] ), MAX('_Measures'[p-value])<=0.05 && 'PMS_FINANCIAL_PDS'[TAU 1] < 0)) +0
1 ACCEPTED SOLUTION

your code could look something like this

Downward =
CALCULATE (
    COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] ),
    FILTER ( ALL ( 'PMS_FINANCIAL_PDS' ), MAX ( [p-value] ) <= 0.05 && [TAU 1] < 0 )
) + 0

 

But, are '_Measures'[p-value] a variable in this measure? It is not part of the code you posted.

View solution in original post

4 REPLIES 4
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @Anonymous ,

 

Just had a look at your measure.

Are '_Measures[p-value] and 'PMS_FINANCIAL_PDS'[TAU 1] measures? It is considered best practise to reference measures without prefixing with table-names, it makes it easier to read and understand code.

 

Are you sure the ALLSELECTED-function is necessary? It is a tricky function: The definitive guide to ALLSELECTED

What do you want to achieve with ALLSELECT? Could it be replaced with ALL or ALLEXCEPT?

 

Cheers,
Sturla

 

 

Anonymous
Not applicable

Hi Sturla
Are '_Measures[p-value] and 'PMS_FINANCIAL_PDS'[TAU 1] measures? YES
NOT SURE ON second part of question I'll try..

Also you mention It is considered best practise to reference measures without prefixing with table-names, it makes it easier to read and understand code. Do you have an example..what declare this as a variable

your code could look something like this

Downward =
CALCULATE (
    COUNTA ( 'PMS_COMPLAINT'[MATERIAL_ID] ),
    FILTER ( ALL ( 'PMS_FINANCIAL_PDS' ), MAX ( [p-value] ) <= 0.05 && [TAU 1] < 0 )
) + 0

 

But, are '_Measures'[p-value] a variable in this measure? It is not part of the code you posted.

Anonymous
Not applicable

Sorry. Miss read your question Yes they both are variables.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors