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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
LRCSG
Helper I
Helper I

DAX - Calculate scores using data from more than one column

Hello,

I have a situation where I have a table of results that is:

 

Survey IDRestaurant 1Restaurant 1 Service Satisfaction:Restaurant 2Restaurant 2 Service Satisfaction:Restaurant 3Restaurant 3 Service Satisfaction:
1000001Dutch Coffee10    
1000002Baba Chop9Dutch Coffee7Soo Bar5
1000003Dutch Coffee8Soo Bar9  
1000004Soo Bar9Square Pizza5  
1000005Square Pizza5    
1000006Square Pizza6  Dutch Coffee10
1000007Baba Chop2Dutch Coffee10  
1000008Soo Bar7Baba Chop10Dutch Coffee7
1000009Baba Chop8Square Pizza5  
1000010      
1000011Soo Bar10Baba Chop10  
1000012Square Pizza9Soo Bar10  
1000013Dutch Coffee8Soo Bar7  
1000014      
1000015Soo Bar9Baba Chop10Square Pizza3

 

and I am trying to get the following results from the survey responses in the table above.

 

  • Overall service satisfaction is 48.2% 
  • Dutch Coffee service satisfaction is 43%
  • Baba Chop service satisfaction is 66.7%
  • Soo Bar service satisfaction is 62.5%
  • Square Pizza service satisfaction is 16.7%

 

Here's what I came up with and I can't get get a way to do this.

Here's one DAX I tried.

 

Restaurant Service Satisfaction =
DIVIDE(
     CALCULATE(
         COUNT('Table1'[Restaurant 1 Service Satisfaction:])
              && COUNT('Table1'[Restaurant 2 Service Satisfaction:])
              && COUNT('Table1'[Restaurant 3 Service Satisfaction:]),
FILTER(
     'Table1',
             'Table1'[Restaurant 1 Service Satisfaction:]*1>=9
                      && 'Table1'[Restaurant 2 Service Satisfaction:]*1>=9
                      && 'Table1'[Restaurant 3 Service Satisfaction:]*1>=9)),
     CALCULATE(
            COUNT('Table1'[Restaurant 1 Service Satisfaction:])
                     && COUNT('Table1'[Restaurant 2 Service Satisfaction:])
                     && COUNT('Table1'[Restaurant 3 Service Satisfaction:]),
FILTER(
     'Table1',
           'Table1'[Restaurant 1 Service Satisfaction:]*1>=1
                     && 'Table1'[Restaurant 2 Service Satisfaction:]*1>=1
                     && 'Table1'[restaurant 3 Service Satisfaction:]*1>=1)))
5 REPLIES 5
v-xiaotang
Community Support
Community Support

Hi @LRCSG 

Thanks for reaching out to us.

>>

  • Overall service satisfaction is 48.2% 
  • Dutch Coffee service satisfaction is 43%
  • Baba Chop service satisfaction is 66.7%
  • Soo Bar service satisfaction is 62.5%
  • Square Pizza service satisfaction is 16.7%

Not sure how you calculated the expected results above, from the description of the post it doesn't seem to mention the calculation formula. Could you share it? thanks.

 

>>How can I attach a PBI file here?

You can refer to my red text at the bottom of this post, or refer to this link I just answered

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Total-sales-Relative-Date-Show-sales-for-all-...

 

Best Regards,

Community Support Team _Tang

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

Hello @v-xiaotang and thank you for offering assistance.

I obtained the following results by using this manual calculation for each of the restaurants:

Example:

 

Dutch Coffee Service Satisfaction =

Count all 9 & 10 scores given to dutch coffee from the columns

[Restaurant 1 Service Satisfaction:]

[Restaurant 2 Service Satisfaction:]

[Restaurant 3 Service Satisfaction:]

Divide

Count all responses given to dutch coffee from the columns

[Restaurant 1 Service Satisfaction:]

[Restaurant 2 Service Satisfaction:]

[Restaurant 3 Service Satisfaction:]

 

Thus

Dutch Coffee Service Satisfaction = 3 divide 7 = 43%

 

 

LRCSG
Helper I
Helper I

Hello @JihwanKim, if you have time to take a look at this, I'll greatly appreciate any help I can get.

Anonymous
Not applicable

Hi

 

Try this. I had created a table (Postes) with all keyword in Restaurant 1 to solve this.

JamesFr06_0-1657287515297.png

test =
var target=SELECTEDVALUE(postes[Restaurant 1])
var ttlrest1=calculate(COUNTROWS(FILTER(Feuil3,Feuil3[Restaurant 1]=target)))
var ttlrest2=calculate(COUNTROWS(FILTER(Feuil3,Feuil3[Restaurant 2]=target)))
var ttlrest3=calculate(COUNTROWS(FILTER(Feuil3,Feuil3[Restaurant 3]=target)))
var totalTarget = ttlrest1+ttlrest2+ttlrest3
var ttlrest1sup9c=calculate(COUNTROWS(FILTER(Feuil3,Feuil3[Restaurant 1]=target)),Feuil3[Restaurant 1 Service Satisfaction:]>=9)
var ttlrest2sup9=calculate(COUNTROWS(FILTER(Feuil3,Feuil3[Restaurant 2]=target)),Feuil3[Restaurant 2 Service Satisfaction:]>=9)
var ttlrest3sup9=calculate(COUNTROWS(FILTER(Feuil3,Feuil3[Restaurant 3]=target)),Feuil3[Restaurant 3 Service Satisfaction:]>=9)
var totalTargetSup9 = ttlrest1sup9c+ttlrest2sup9+ttlrest3sup9
return
divide(totalTargetSup9,totalTarget)

Hello @Anonymous ,

Thank you for trying to help.

I tried your method but I can't figure out why it does not give me the same outcome.

Would you mind pointing me in the right direction? How can I attach a PBI file here?

 

LRCSG_0-1657587340298.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.