Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX

Hi Paul,

distinct count of sales =
CALCULATE (
distinctcount('fact'[order_id],
FILTER ( 'Dim Channel', [Exclude Dim Channel] >= 1 ),
FILTER ( 'Dim Item', [Exclude Dim Item] >= 1 ),
FILTER ( 'Dim REF', [Exclude Dim REF] >= 1 )
)

This measure is taking ages to load.

Could you please help me with this?

PaulDBrown 

  • Anonymous 

    Can you try the following?. 

    distinct count of sales =
    CALCULATE (
        SUMX ( DISTINCT( 'fact'[order_id] ) , 1 ),
        FILTER ( 'Dim Channel', [Exclude Dim Channel] >= 1 ),
        FILTER ( 'Dim Item', [Exclude Dim Item] >= 1 ),
        FILTER ( 'Dim REF', [Exclude Dim REF] >= 1 )
    )
    

     

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi sarjensystems1 Thanks for the reply- I tried that but it didn't help

      • sarjensystems1's avatar
        sarjensystems1
        Helper III

        Then, instead of using measure use calculated columns by making flags (for conditions i.e. ">=1") , it might doesn't takes too much time to load calculation unlike measure.

  • Anonymous 

    Can you try the following?. 

    distinct count of sales =
    CALCULATE (
        SUMX ( DISTINCT( 'fact'[order_id] ) , 1 ),
        FILTER ( 'Dim Channel', [Exclude Dim Channel] >= 1 ),
        FILTER ( 'Dim Item', [Exclude Dim Item] >= 1 ),
        FILTER ( 'Dim REF', [Exclude Dim REF] >= 1 )
    )