cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Angie_ Frequent Visitor
Frequent Visitor

Get sample to cover at least certain % over the total

Hi

I have a list of items to select for sample. The sample creteria is to cover at least 40% of the total.

So from the list, I should cover at least 2 items.

May I know what is the correct way so that the 2nd item will also show "Sample selected" in the "Review Creteria" column.

Thank you.

 

Sample 1.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Get sample to cover at least certain % over the total

Hi @Angie_ ,

 

Review Creteria = 
VAR ranki =
    RANKX ( FILTER(Table1,Table1[accum]>0.4), Table1[accum],, ASC, DENSE )
RETURN
    IF ( Table1[accum]<=0.4 || ranki =1, "Sample selected", BLANK () )
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Get sample to cover at least certain % over the total

Hi @Angie_ ,

 

To use this formula as below.

 

Review Creteria = 
VAR ranki =
    RANKX ( Table1, Table1[accum],, ASC, DENSE )
RETURN
    IF ( Table1[accum]<=0.4 || ranki <= 2, "Sample selected", BLANK () )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Angie_ Frequent Visitor
Frequent Visitor

Re: Get sample to cover at least certain % over the total

Hi Frank

 

Thanks for the solution. I would like to ask something further.

 

What if every month I have difference amount of sample to be selected, for example it might need more than 2 samples to cover at least 40%. Is there any formula that can auto detect to make sure I cover at least 40% of the total as my sample?

 

Thank you.

 

At least 40%.png

Community Support Team
Community Support Team

Re: Get sample to cover at least certain % over the total

Hi @Angie_ ,

 

Review Creteria = 
VAR ranki =
    RANKX ( FILTER(Table1,Table1[accum]>0.4), Table1[accum],, ASC, DENSE )
RETURN
    IF ( Table1[accum]<=0.4 || ranki =1, "Sample selected", BLANK () )
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)