Forum Discussion

olivierschelstr's avatar
olivierschelstr
Regular Visitor
5 years ago
Solved

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  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()
    )

1 Reply

  • negi007's avatar
    negi007
    Icon for Community Champion rankCommunity 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()
    )