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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
hassens
Regular Visitor

Finding the Best Result Based on Multiple Criteria

Hi,

 

I have a data set similar to the one below. I want to highlight/identify the best result (where answer = 'yes') for each question for each store within a given period. Only one best result should be highlighted given the criteria above so something like the first or last best result would be fine. I have added the intended result in the last column below.

 

Visit IDStore IDQuestionAnswerPeriodDateBestRead?
1AQuestion 1Yes101/01/20171
1AQuestion 2Yes101/01/20171
2AQuestion 1Yes102/01/20170
2AQuestion 2Yes102/01/20170
3AQuestion 1Yes203/05/20171
3AQuestion 2Yes203/05/20171
1BQuestion 1Yes105/01/20171
1BQuestion 2No105/01/20170
2BQuestion 1No110/05/20170
2BQuestion 2Yes110/05/20171

 

What I have been trying is:

 

  1. Adding a column to translate all 'Yes' answers to '1', called YesRead
  2. Trying the following: BestRead = IF(Table[YesRead]=CALCULATE(MAX(Table[YesRead]),ALLEXCEPT(Table,Table[StoreID],Table[Period],Table[Question])),1,0)  which returns a 'A single value for column 'YesRead' in table 'Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.' Also I realise this does not yet incorporate anything to highlight only one best within the criteria.

 

Any help would be appreciated!

 

Thanks Smiley Happy

1 REPLY 1
Anonymous
Not applicable

Hi @hassens,

 

>>I want to highlight/identify the best result (where answer = 'yes') for each question for each store within a given period.

You can try to use below formula to summary records by "question" and "period".

Table = SUMMARIZE(FILTER(ALL(Sheet1),[Answer]="Yes"),[Store ID],[Question],[Period],"Total Read",SUM(Sheet1[BestRead?]))

1.PNG

 


I haven't found a way to highlight records which in the table.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Users online (880)