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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Debasish1011
New Member

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
Zubair_Muhammad
Community Champion
Community Champion

@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
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@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
    )
)

Regards
Zubair

Please try my custom visuals

Thanks a lot Zubair, its working

@Zubair_Muhammad

 

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.

@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
    )
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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