Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
5 years ago
Solved

Total distinctive

To one extent I have calculated:

I have the distinctive count of stores that had sales greater than zero, this for a string field.

I would like to get in a table the total or sum of the stores, since it is giving me back the sum of the total.

I'd really appreciate your help. Best regards

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Syndicate_Admin ,

     

    Based on your description, you can create a measure as follows.

    I did a test.

    Measure 4 = 

    var x1=CALCULATE(DISTINCTCOUNT('test for sales'[Store]),FILTER(ALL('test for sales'),[Sales]<=0))

    var x2=DISTINCTCOUNT('test for sales'[Store])

    return

    x2-x1

    Result:

    Hope that's what you were looking for.

    Best Regards,

    Yuna

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Syndicate_Admin , Not very clear

     

    see if these measures can help

    Store sales >0 = count(filter(values(Table[Store]), CALCULATE(sum(Table[Sales])) >0),[Store])

     

    Store Sales when sales >0 = sumx(filter(values(Table[Store]), CALCULATE(sum(Table[Sales])) >0),CALCULATE(sum(Table[Sales])))

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Hello, shows me error in the count, I have the following measure:

      CALCULATE(DISTINCTCOUNT(FACT_SALE_VIEW[Store]),FILTER(FACT_SALES_VIEW,FACT_SALE_VIEW[sales]>0))
      *by putting it on the table the total does not show me the sum
      Captura33.PNGI'd appreciate your help. Best regards.
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin ,

     

    Based on your description, you can create a measure as follows.

    I did a test.

    Measure 4 = 

    var x1=CALCULATE(DISTINCTCOUNT('test for sales'[Store]),FILTER(ALL('test for sales'),[Sales]<=0))

    var x2=DISTINCTCOUNT('test for sales'[Store])

    return

    x2-x1

    Result:

    Hope that's what you were looking for.

    Best Regards,

    Yuna

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.