Forum Discussion

PieroPinzone95's avatar
PieroPinzone95
Frequent Visitor
3 years ago

FILTERED DISTINTCOUNT

Hi guys, i want to calculate a distintcount  as shown in the picture but it give me an error because i'm comparing a "text" value with an "integer" one ... i don't understand well... the filter i'm using is a integer... what i should do? 

2 Replies

    1. Is the column data type you're trying to filter on a text column or a number column? This would affect the filtering heavily. 
    2. I'd recommend that instead of adding in your filter statement as a regular statement wrap it in it's own FILTER function. 
    3. Since you have your 2 and 3 values within double-quotes, DAX will treat these as strings and not integers. This is probably why it isn't working, try removing the quotes. 
  • hi PieroPinzone95 

    try like:

    Flotte Kinto =
    CALCULATE(
    DISTINCTCOUNT(VW_Polizze[IdPolizza]),
    VW_polizze[IdProdotto] in {2, 3}
    )