Forum Discussion

Sab's avatar
Sab
Helper V
6 years ago
Solved

Measure not working when using in table with other columns

Hello, 

I have a column: SCORE with values 1, 2, ..., 10.

 

Then I have 3 measures: 

Detractors = CALCULATE(COUNT('Responses Database'[SCORE]),'Responses Database'[SCORE]<7)
Promoters = CALCULATE(COUNT('Responses Database'[SCORE]),'Responses Database'[SCORE]>8)
NPS = ([Promoters]-[Detractors])/[All Rows]*100
 
The calculation is OK and I can use the measure as Card or when I use it in table with Quarters from DateTable,
but when I use it in table with other columns from same table where SCORE column is, it doesn't work:
 
 
Please advise.
 
Thanks
Sab
 
  • The score column is the one that has values that create the measure.

     

    So the column date is in relationship with Date Table, no problem with Quarters, months etc. 

     

    But the problem is when I put in the table visual along with for example Company column.

     

    I tried your solution, but the values get too low

6 Replies

  • Aron_Moore's avatar
    Aron_Moore
    Solution Specialist

    Keep in mind tables will apply a "filter" context to your measure unless you explicitly tell it not to with a function like ALL().

    • Sab's avatar
      Sab
      Helper V

      Can you please be more specific?

       

      thanks

  • v-eachen-msft's avatar
    v-eachen-msft
    Community Support

    Hi Sab ,

     

    Would you like to provide some sample data? The information you give is limited, I can't get the context of the table.

    And you can try this measure:

    NPS =
     ( [Promoters] - [Detractors] )
        / CALCULATE (
            COUNTROWS ( 'Responses Database' ),
            ALLEXCEPT (
                'Responses Database',
                'Responses Database'[Campany],
                'Responses Database'[Quarter]
            )
        ) * 100

     

      • Sab's avatar
        Sab
        Helper V

        The score column is the one that has values that create the measure.

         

        So the column date is in relationship with Date Table, no problem with Quarters, months etc. 

         

        But the problem is when I put in the table visual along with for example Company column.

         

        I tried your solution, but the values get too low