Forum Discussion

alexcatala's avatar
alexcatala
Helper IV
4 years ago
Solved

Count only specific rows

Hi,

 

I am currently working on a formula to count the number of ratings that are >=2 and divide it against the number of applicants per store:

 

Qualified candidates =
VAR __BASELINE_VALUE =
CALCULATE(
COUNTA('Application Report'[Average rating]),
'Application Report'[Average rating] >=2
)
VAR __MEASURE_VALUE = sum('Job Report'[Number of Applications])
RETURN
DIVIDE( __BASELINE_VALUE,__MEASURE_VALUE )

 

 

DATA:

Application Report:

StoreAverage Rating
7023.00
7022.50

104

3.00

104

1.50

705

1.00

 

Job Report:

StoreNumber of Applications
70245
70525
10430

 

Unfortunately, I couldn't find a way to count them and be able to filter them per store.

 

I hope it makes sense.

 

Thanks for your support.

  • Hi, alexcatala ;

    Hi, alexcatala ;

    Try it.

     

    Qualified candidates = 
    VAR __BASELINE_VALUE =
        CALCULATE (
            SUM( 'Application Report'[Average rating] ),FILTER('Application Report',
            [Average rating] >= 2))
    VAR __MEASURE_VALUE =
        SUM ( 'Job Report'[Number of Applications] )
    RETURN
        DIVIDE ( __BASELINE_VALUE, __MEASURE_VALUE )
     

     

    The final show:

    or can you share desired result,  which could let me understand your logic?

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

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

    Hi, alexcatala ;

    Hi, alexcatala ;

    Try it.

     

    Qualified candidates = 
    VAR __BASELINE_VALUE =
        CALCULATE (
            SUM( 'Application Report'[Average rating] ),FILTER('Application Report',
            [Average rating] >= 2))
    VAR __MEASURE_VALUE =
        SUM ( 'Job Report'[Number of Applications] )
    RETURN
        DIVIDE ( __BASELINE_VALUE, __MEASURE_VALUE )
     

     

    The final show:

    or can you share desired result,  which could let me understand your logic?

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • alexcatala's avatar
      alexcatala
      Helper IV

      Hi amitchandak ,

       

      I have already a common table, such as a store and data table. 

       

      What I need is a formula to give me the percentage of the average rating bigger than 2 divided with the number of applicants.

       

      I have tried with the If formula but only 1 option can be given and I need all numbers from 2 to 5 to be included.

       

      I used it before to filter a specific value  ( text) but now I need to filter several values (whole number).

       

      Any advice?