Forum Discussion

Oros's avatar
Oros
Post Prodigy
2 years ago
Solved

DistincCount with Filter

Hello,   I have a measure that works using DISTINCOUNTNOBLANK. How do you add a filter to this measure, for example, ONLY distinct count "the product number that starts in number 1 and 2"? Thanks...
  • speedramps's avatar
    speedramps
    2 years ago

    The solution will works. Please try copy it carefully. Then click accept solution. Thanks.

    Answer =
    VAR tempfile = FILTER('yourtable',NOT LEFT('yourtable'[PRODUCT NUMBER],1) IN {"2","3"})
    RETURN
    CALCULATE(
    DISTINCTCOUNT('yourtable'[PRODUCT NUMBER]),
    tempfile)