Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sab
Helper V
Helper V

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:
 
New Message - Microsoft Power BI Community - Microsoft Edge.jpg
 
Please advise.
 
Thanks
Sab
 
1 ACCEPTED SOLUTION

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

View solution in original post

6 REPLIES 6
v-eachen-msft
Community Support
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

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

NPS - Power BI Desktop.jpg

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

There was no problem in measures, just the dummy data created that illusion...

 

Thanks all who took time to look at this.

Aron_Moore
Solution Specialist
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().

Can you please be more specific?

 

thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.