Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Distinct Count ignoring one column plus calculate average

Hello, all!   I have the following table  And im trying to get a simple DISTINCT COUNT[ID] but its not working because the column Type has two different values (B and E). If i use a mesure,...
  • barritown's avatar
    2 years ago

    Hi Anonymous,

    Try this piece of code:

    In plain text:

    Avg_Distinct_ID = 
    VAR _tbl = SUMMARIZE ( 'Table', [Year], [Month], "dValue", DISTINCTCOUNT ( 'Table'[ID] ) ) 
    RETURN AVERAGEX ( _tbl, [dValue] )

    Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian