Forum Discussion

himanimistry's avatar
himanimistry
New Member
1 year ago
Solved

Visual has exceeded available resources - how to optimize dax code?

Hi there,    I think my DAX code is slowing down my visual, it will not load because the code is taking too long to run for each column of my table visual. How can i optimize my code or make it mor...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi ALL,
    Firstly  MFelix and  johnt75  thank you for yours solutions!
    And himanimistry , For your first code, you can combine the FILTER condition into a single FILTER function, which can be used to reduce the number of iterations, and you can leave out the RELATEDTABLE if the table relationships are already defined in the model. reduce the complexity of the code, as MFelix and johnt75 wrote


    If the amount of data is too large, using maxx will increase the computation time unnecessarily, you can try the combination of caculate and max to optimize the code.

    FON304 Date(optimize) = 
    CALCULATE(
        MAX(CSPS_TRANSCRIPT[Transcript Completion Date]),
        CSPS_TRANSCRIPT[NextGen Course Code] = "FON304" &&
        CSPS_TRANSCRIPT[Transcript Status] = "Completed Successfully"
    )

    If you have further questions, check out the pbix file I uploaded, I hope it helps, and I'd be honored if I could help you out!

    Hope it helps!

    Best regards,
    Community Support Team_ Tom Shen

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