Forum Discussion

Dimitris_Kats's avatar
4 years ago

Simplify DAX formula

Hello Dear members.

I have the following dax:

 

CALCULATE(
Credit'[Overdue]
,
KEEPFILTERS(
CALCULATETABLE(
TOPN(
'Top Customers'[Value],'Credit', 'Credit'[Overdue], DESC ), ALLSELECTED() )))

 

This is a real consuming DAX and constanty i am getting an error.
Is there any way to make it simplier and less consuming?

 

Thank you very much!

3 Replies

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

    Dimitris_Kats 
    what is  'Top Customers'[Value]? a measure?
    anyway try:
    Measure =
    CALCULATE (
        [Overdue],
        TOPN ( 'Top Customers'[Value], ALLSELECTED ( 'Credit' ), [Overdue], DESC )
    )

  • Hello.

     

    Thank you very much for your suggested solution and I am so sorry for the late reply.
    Unfortunately i am still getting a memory error with this measure 😞
    Is there any way to make it even lighter?

     

    Thank you again!