Forum Discussion

alsolok's avatar
alsolok
Helper II
4 years ago
Solved

Low performance measures

Hello everyone,

 

I have the problem the performance on the measures:

The measures is slow 

 

% modif = DIVIDE(CALCULATE([Nb clients], FILTER('Client', 'Client'[mail] = 1 && 'Client'[tel]=0 && 'Client'[date_modif]<>BLANK()),USERELATIONSHIP('Agent'[id_agent],'Client'[agent_modif]),USERELATIONSHIP('Emplacement'[libelle_empl],'Client'[modif_CEB])),CALCULATE([Nb clients],'Client'[date_modif]<> BLANK()),0).

I search the solution to performance.

Do you have the alternative optimized

  • alsolok this is an optimized version for your code:

     

    % modif = 
    DIVIDE (
        CALCULATE (
            [Nb clients],
            KEEPFILTERS(
    	        FILTER (
    	            ALL('Client'[mail], 'Client'[tel], 'Client'[date_modif] ),
    	            'Client'[mail] = 1
    	                && 'Client'[tel] = 0
    	                && 'Client'[date_modif] <> BLANK ()
    	        )
    	    ),
            USERELATIONSHIP ( 'Agent'[id_agent], 'Client'[agent_modif] ),
            USERELATIONSHIP ( 'Emplacement'[libelle_empl], 'Client'[modif_CEB] )
        ),
        CALCULATE ( [Nb clients], 'Client'[date_modif] <> BLANK () ),
        0
    )

     


    Let me know if that helped.





          

    Showcase Report – Contoso By SpartaBI

2 Replies

  • SpartaBI's avatar
    SpartaBI
    Community Champion

    alsolok this is an optimized version for your code:

     

    % modif = 
    DIVIDE (
        CALCULATE (
            [Nb clients],
            KEEPFILTERS(
    	        FILTER (
    	            ALL('Client'[mail], 'Client'[tel], 'Client'[date_modif] ),
    	            'Client'[mail] = 1
    	                && 'Client'[tel] = 0
    	                && 'Client'[date_modif] <> BLANK ()
    	        )
    	    ),
            USERELATIONSHIP ( 'Agent'[id_agent], 'Client'[agent_modif] ),
            USERELATIONSHIP ( 'Emplacement'[libelle_empl], 'Client'[modif_CEB] )
        ),
        CALCULATE ( [Nb clients], 'Client'[date_modif] <> BLANK () ),
        0
    )

     


    Let me know if that helped.





          

    Showcase Report – Contoso By SpartaBI

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, alsolok 

     

    Can you provide some sample data or simple pbix files? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures.

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.