Forum Discussion
Anonymous
6 years agoNot 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 themselve...
- 6 years ago
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 ) ) + 0But, are '_Measures'[p-value] a variable in this measure? It is not part of the code you posted.
sturlaws
Resident Rockstar
6 years agoHi, 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
- Anonymous6 years agoNot applicableHi 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- sturlaws6 years ago
Resident Rockstar
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 ) ) + 0But, are '_Measures'[p-value] a variable in this measure? It is not part of the code you posted.
- Anonymous6 years agoNot applicableSorry. Miss read your question Yes they both are variables.