Forum Discussion

basirve's avatar
basirve
Icon for Helper III rankHelper III
5 years ago

DAX Query preforming Very Slow.

Dear Experts,

Below Dax Measure perfomance very slow, Kindly advise the best solution,

NPS NetworkRank:
RANKX (
ALL (
Dim_Agent[Team_Lead_Complete_Name],
Dim_Agent[Supervisor_Complete_Name],
Dim_Agent[Manager_Complete_Name],
Dim_Agent[Director_Complete_Name],
Dim_Agent[CRC]
),
CALCULATE (
[_AvgNPSSelectionMTD],
Dim_Agent[_MissingHierarchy1] = "|||"
 
),
,
DESC,
SKIP
)

 

_Avg NPS Rank =
AVERAGEX (
KEEPFILTERS (
CROSSJOIN (
VALUES ( 'Dim_Agent'[Director_Complete_Name] ),
VALUES ( 'Dim_Agent'[Manager_Complete_Name] ),
VALUES ( 'Dim_Agent'[Supervisor_Complete_Name] ),
VALUES ( 'Dim_Agent'[Team_Lead_Complete_Name] ),
VALUES ( Dim_Agent[Job_Description] )
)
),
CALCULATE ( [_NPS_NetworkRank] )
)

Thanks & Regards,
Venkat.

2 Replies

  • aj1973's avatar
    aj1973
    Icon for Community Champion rankCommunity Champion

    Hi basirve 

    Can you please share a Sample Pbix! it's not easy to speculate on a solution.

     

  • v-lionel-msft's avatar
    v-lionel-msft
    Icon for Community Support rankCommunity Support

    Hi basirve ,

     

    Review performance of measures, relationships, and visuals - Learn | Microsoft Docs

    There are many factors that affect the query performance, and the DAX formula itself is only one of them.

    Improve Power BI Performance by Optimizing DAX | MAQ Software

    And maybe you can refer these.

    NPS NetworkRank:
    RANKX (
        ALL (Dim_Agent),
        CALCULATE (
            [_AvgNPSSelectionMTD],
            Dim_Agent[_MissingHierarchy1] = "|||"
        ), , DESC, SKIP
    )
    
    Avg NPS Rank = 
    AVERAGEX (
        CROSSJOIN (
            VALUES ( 'Dim_Agent'[Director_Complete_Name] ),
            VALUES ( 'Dim_Agent'[Manager_Complete_Name] ),
            VALUES ( 'Dim_Agent'[Supervisor_Complete_Name] ),
            VALUES ( 'Dim_Agent'[Team_Lead_Complete_Name] ),
            VALUES ( Dim_Agent[Job_Description] )
        ),
        [_NPS_NetworkRank]
    )

     

    Best regards,
    Lionel Chen

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