Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to create Average DistinctCount?

Hi all, I'm trying to create the following DAX:   CALCULATE     (DIVIDE([Average Per Day],         AVERAGE(DISTINCTCOUNT(AllInvoiceDetails[System]))),             'AllInvoiceDetails'[Year] IN ...
  • v-zhangti's avatar
    4 years ago

    Hi, Anonymous 

     

    You can try the following formula.

    Measure:

    Measure =
    VAR N1 =
        DISTINCTCOUNT ( AllInvoiceDetails[System] )
    VAR N2 =
        AVERAGEX (
            FILTER ( ALL ( AllInvoiceDetails ), AllInvoiceDetails[Year] = 2021 ),
            N1
        )
    RETURN
        DIVIDE ( [Average Per Day], N2 )
    

    If that doesn't solve your problem, can you provide some sample data? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures.

     

    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.