cancel
Showing results for
Did you mean:
Debasish1011 Frequent Visitor

Want to find the number of Suppliers with Average Rating between 4 and 5

Hi

I have data in the following format:

Supplier ID            Rating Value

-------------          ------------------

123                            4

123                            5

234                            1

567                            2

345                            4

234                            4

I want to find the count of suppliers whose average rating is between 4 and 5.

Average rating of a supplier = Sum of Ratings received by the supplier/Total no. of ratings received by the supplier

1 ACCEPTED SOLUTION

Accepted Solutions Super User

Re: Want to find the number of Suppliers with Average Rating between 4 and 5

@Debasish1011

Try thsi MEASURE

Count_of_Suppliers =
COUNTROWS (
FILTER (
ALLSELECTED ( Table1[Supplier ID] ),
CALCULATE ( AVERAGE ( Table1[Rating Value] ) ) >= 4
&& CALCULATE ( AVERAGE ( Table1[Rating Value] ) ) <= 5
)
)
4 REPLIES 4 Super User

Re: Want to find the number of Suppliers with Average Rating between 4 and 5

@Debasish1011

Try thsi MEASURE

Count_of_Suppliers =
COUNTROWS (
FILTER (
ALLSELECTED ( Table1[Supplier ID] ),
CALCULATE ( AVERAGE ( Table1[Rating Value] ) ) >= 4
&& CALCULATE ( AVERAGE ( Table1[Rating Value] ) ) <= 5
)
)
Debasish1011 Frequent Visitor

Re: Want to find the number of Suppliers with Average Rating between 4 and 5

Thanks a lot Zubair, its working

Debasish1011 Frequent Visitor

Re: Want to find the number of Suppliers with Average Rating between 4 and 5

Can we help me with another condition please.

How to calculate the number of Suppliers with Average Rating between 4 and 5 but will only consider the Suppliers who have got more than one rating count. Super User

Re: Want to find the number of Suppliers with Average Rating between 4 and 5

@Debasish1011

You can add another condition as follows

Count Of Suppliers =
COUNTROWS (
FILTER (
ALLSELECTED ( Table1[Supplier ID] ),
CALCULATE ( AVERAGE ( Table1[Rating Value] ) ) >= 4
&& CALCULATE ( AVERAGE ( Table1[Rating Value] ) ) <= 5
&& CALCULATE ( COUNT ( Table1[Rating Value] ) ) > 1
)
)

Announcements Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge. Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform. Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag. Top Kudoed Authors
Users Online
Currently online: 140 members 1,549 guests
Recent signins:
• Ross73312 • manalla • vimal_parmar • Shamsbutt • newgirl • prakash11440278 • Ritaf • kennywang30 • v-sagaik • Dinesh5 • Hayleysea • UdaykrishnaG • alfsender • aschlecte 