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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
justinMcC
Frequent Visitor

Filter data using slicer (1 table to another)

Hi 

 

I have a report that I need the end user to be able to categorise a 'holding' on my 'holdings table' as either beef or dairy based on a percent using a visual filter, eg slicer. The filter is based of a percentage, ie, if the holding has 'PERCENT_DAIRY'>= x then categorise these holdings as 'Dairy', else categorise as beef

 

Below is the sample data:

 

HOLDINGID     PERCENT_DAIRY   

Holding_1        60

Holding_2        80

Holding_3        40

Holding_4        20

Holding_5        90

Holding_6        94

 

If the end user uses a filter, eg slicer to say that any holding with 'PERCENT_DAIRY' IS >= 80 then 'dairy' else 'beef'

 

END RESULT:

 

HOLDINGID     PERCENT_DAIRY  CATEGORY 

Holding_1        60                        BEEF

Holding_2        80                        DAIRY

Holding_3        40                        BEEF

Holding_4        20                        BEEF

Holding_5        90                        DAIRY

Holding_6        94                        DAIRY

 

I have the 'holding' table with holding data (see above) and a 'percent' table showing values 1 - 100

 

My question is how do I create a custom category (ie, dairy, beef) based on the percent choosen by the end user 

 

Thank you for any help you can provide.

1 ACCEPTED SOLUTION
mehaboob557
Resolver III
Resolver III

Hi @justinMcC,

 

Create 2 Measures to achieve this ac below.

 

Measure 1:

 

Calculate Dairy % = CALCULATE(SUMX(your_table_name, your_table_name[PERCENT_DAIRY]),ALLEXCEPT(your_table_name, your_table_name[HOLDINGID]))

Measure 2:

 

Category = IF([Calculate Dairy %] >= 80, "DAIRY","BEEF")

dataasas.PNG

 

Please give a kudo and Accept the soultion if it works for you.

 

Thanks,

Mehbub- India

View solution in original post

4 REPLIES 4
mehaboob557
Resolver III
Resolver III

Hi @justinMcC,

 

Create 2 Measures to achieve this ac below.

 

Measure 1:

 

Calculate Dairy % = CALCULATE(SUMX(your_table_name, your_table_name[PERCENT_DAIRY]),ALLEXCEPT(your_table_name, your_table_name[HOLDINGID]))

Measure 2:

 

Category = IF([Calculate Dairy %] >= 80, "DAIRY","BEEF")

dataasas.PNG

 

Please give a kudo and Accept the soultion if it works for you.

 

Thanks,

Mehbub- India

Hi @mehaboob557

 

Thanks for all your help, your solution worked

 

The next step I have however is to create a chart from the results, ie Beef = 4, Dairy = 4, however I cant use a measure is a chart

 

Do you know how to turn a measure into a column?

 

Again thank you for the above, your help was much appreciated

Show me some output how you need.

 

If possible create a new forum post and send me the link . I will check and if possible i will help

Hi @mehaboob557

 

I created another topic on forum, here is the link:

 

http://community.powerbi.com/t5/Desktop/Turning-a-column-into-a-measure/m-p/331989#M148440

 

Any help you could give would be much appreciated

 

Thanks 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.