Forum Discussion

saadat_rda's avatar
saadat_rda
Frequent Visitor
3 years ago
Solved

SUMX in direct querry mode

Hi,

 

I would like to calculate the total based on the client group.

To calculate this I used the DAX expression:

Column = SUMX(FILTER('Table','Table'[ClientGroup]=EARLIER('Table'[ClientGroup])),'Table'[WIP])
 
 
However, i get the error: SUMX is is not allowed in Direct Querry mode.
 
How can I work around this issue?
 
Thank you in advance
  • saadat_rda , You have to create a measure

     

    = SUMX(FILTER(allselected('Table'),'Table'[ClientGroup]=max('Table'[ClientGroup])),'Table'[WIP])

3 Replies

  • saadat_rda , You have to create a measure

     

    = SUMX(FILTER(allselected('Table'),'Table'[ClientGroup]=max('Table'[ClientGroup])),'Table'[WIP])

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, saadat_rda 

     

    You can try the following methods.

    Measure =
    CALCULATE (
        SUM ( 'Table'[WIP] ),
        FILTER (
            ALL ( 'Table' ),
            [ClientGroup] = SELECTEDVALUE ( 'Table'[ClientGroup] )
        )
    )
    

     

    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.

    • saadat_rda's avatar
      saadat_rda
      Frequent Visitor

      Hello, thank you for your suggestion, it worked.