Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX DISTINCTCOUNT Performance, Aggregrate vs Line Level

I have a DISTINCTCOUNT of an SK from my Fact table.

 

On a card, in the aggregrate, this measure is performant and populates quickly.

 

But in a table, at the detail level, the distinctcount measure takes more than 20 seconds. If I pull in a field from a dimension to the table, it's even worse, often causing a memory error for the visual.

  • Anonymous's avatar
    Anonymous
    7 years ago
    I figured out what was causing the measures to not be performant in a detail, table visualization: On the DISTINCTCOUNT measures...I had added a "+0" to the end of them. This allows the cards to show 0 if the count is zero for the filter context on the report. But for a table, these measures were *very* slow. Taking that "+0" out of the DAX made them performant. I'm not sure exactly *why*, but at least I figured out what was causing the difference.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    I figured out what was causing the measures to not be performant in a detail, table visualization: On the DISTINCTCOUNT measures...I had added a "+0" to the end of them. This allows the cards to show 0 if the count is zero for the filter context on the report. But for a table, these measures were *very* slow. Taking that "+0" out of the DAX made them performant. I'm not sure exactly *why*, but at least I figured out what was causing the difference.
    • v-chuncz-msft's avatar
      v-chuncz-msft
      Icon for Community Support rankCommunity Support

      Anonymous,

       

      Glad to hear that. You may help accept the solution above. Your contribution is highly appreciated.