Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

how to Count distinct date value by Name ?

hello,    How to calculate distinct date value by Name? want dax for it. I want this column in power bi ( countdistinct of date by Name). Plus then sum all the values of name single time.  ...
  • az38's avatar
    az38
    6 years ago

    Anonymous 

    as you use a date slicer you could try this

    Measure = 
    var _minDate = CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table'))
    var _maxDate = CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
    return
    SUMX(SUMMARIZE('Table', 'Table'[Name], "DistinctDates", 
    CALCULATE(DISTINCTCOUNT('Table'[Date]), ALLEXCEPT('Table','Table'[Name]), DATESBETWEEN('Table'[Date], _minDate, _maxDate))),[DistinctDates]
    )

    to notificate me about new questions please mark me with @ symbol