Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Cumulative distinct count

hello everyone.    On my dasbhoard I have a slicer for Fiscal Month and its still filtering my DAX and I cannot figure out why.    What I am trying to calculate is the disctint count of Customer ...
  • AmiraBedh's avatar
    2 years ago

    I think the issue with your measure might be related to the way the ALL function is being used, particularly in the context of your slicers.

     

    Try the following : 

     

    Measure =
    VAR CurrentFY = MAX('Calendar'[Fiscal Year])
    VAR MaxMonth = SELECTEDVALUE('Calendar'[Fiscal Month])
    
    VAR Results =
    CALCULATE(
        DISTINCTCOUNT(Customer[CustomerID]),
        ALLEXCEPT('Calendar', 'Calendar'[Fiscal Year]),
        'Calendar'[Fiscal Year] = CurrentFY,
        'Calendar'[Fiscal Month] <= MaxMonth,
        FILTER(
            Customer,
            [Total Offers] >= 1
        )
    )
    
    RETURN Results