Forum Discussion

skorpion's avatar
skorpion
Helper I
8 years ago

Count and sum unique Values

Im trying to get the sum of Sales with uniuqe Catatery im using thus DAX Formula please anyone can help me in this

 

Countoracle = CALCULATE(SUM('Data Source'[Sales) ,DISTINCTCOUNT ('Data Source'[ItemAr]))

 

getting error 

The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

13 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    skorpion  why are you combining 2 different measures?

     

    this should give you the total sum

    SumofSales= CALCULATE(SUM('Data Source'[Sales) )

    Countoracle = CALCULATE(DISTINCTCOUNT ('Data Source'[ItemAr])

     

    what result are you expecting?, if you create them separately then place them on your visual you can still see them together.

     

    please give an example of what you hope to achieve

    • skorpion's avatar
      skorpion
      Helper I

      yea but when i sum value it will sum all Cataery which repeat and have twice so i need Uniqe sum 

      • vanessafvg's avatar
        vanessafvg
        Community Champion

        skorpion please provide an example of what you expecting as i am unclear what you trying to do

         

        are you wanting to count the total products, total categories, total sales value

         

        provide an example of what it should look like

  • Hi skorpion ,

    Could you please explain indetaled .

    Assume you have the data like bellow

    Category Value

    A               100

    A                200

    B                50

    B                60

    Do you want to sum value for each category or do you  need max value from each category what is your requirement ??

    Please explain in detailed.

    If you need Sum of value for each category .

    Create measure M1 = CALCUALTE(SUM(Value)) and then drag this measure and Category in your report will work .

     

    Reply me if you need further assistance.

     

    Regards,

    Venu Gopal

      • vanessafvg's avatar
        vanessafvg
        Community Champion

        skorpion place the category on your visual, and then create the sum measure and put that on your visual and you will then seen what you asking for