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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
olivierschelstr
Regular Visitor

Bart graph with slicer?

Hi,

 

For a vegetable harvesting company I have to build a report showing the daily harvested volumes.

I have the following data:

- KG harvested per day

- Same as above but in Wooden Chests equivalent

 

I would like to have the bar graph below show either KG or Chests, depending on a slicer. How do I need to configure this in my visuals or data?

 

Thank you in advance,

 

olivierschelstr_0-1618410671355.png

 

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@olivierschelstr  in this case, you can create a table with your slicer values like KG, Chests

 

then you create a measure like below which will based on the selection show the value in the chart

Data_type_Filter_value =
IF(HASONEFILTER(Data_Type_Selected[Selection]),
SWITCH(SELECTEDVALUE(Data_Type_Selected[Selection]),
"KG", SUM('1_KG'),
"Chests", SUM('2_Chests)
 ),
BLANK()
)



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

1 REPLY 1
negi007
Community Champion
Community Champion

@olivierschelstr  in this case, you can create a table with your slicer values like KG, Chests

 

then you create a measure like below which will based on the selection show the value in the chart

Data_type_Filter_value =
IF(HASONEFILTER(Data_Type_Selected[Selection]),
SWITCH(SELECTEDVALUE(Data_Type_Selected[Selection]),
"KG", SUM('1_KG'),
"Chests", SUM('2_Chests)
 ),
BLANK()
)



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors