Forum Discussion

Safal's avatar
Safal
Frequent Visitor
3 years ago
Solved

Measure to filter graphs

Hi guys, 

 

I am trying to filter a graph using another graph. 

i got graph A, and Table B. they are both connected to a date table. 

 

Graph A is a bar graph and has 2 fields, ranking and new. new is just numbers, ranking{1, 2, 3} based on date. 

 

 

 

Table is a list of table. I want to filter so when i click on ranking 1 on the graph, it will filter the Table on Description. 
here is the code i got - im not the best powerBI user. please help.

 

Filtering=

VAR SelectedRanking = SELECTEDVALUE('ds_Trend'[RANKING])

var rank1 = "Materials,Diameter"

var rank2 = "Design.Max.Pressure,Design.Max.Temperature,AlternateDesign.Max.Pressure,AlternateDesign.Max.Temperature"

RETURN

SWITCH(

    SelectedRanking,

    1, CALCULATETABLE('ds_List', ds_List[DESCRIPTION] = rank1),

    2, CALCULATETABLE('ds_List', ds_List[DESCRIPTION]) =rank2,

    3, CALCULATETABLE(ds_List, NOT(ds_List[DESCRIPTION] IN {rank1, rank2}))

)

 

its giving me this error. 

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

not sure what it means. 

  • to solve this, what i did was. 

    create a slicer, then added it on the bottom of the graph, then removed the graph x axis. and made it look blended with the graph. as if its the button you press, rather than the graph itself. 

     

     

3 Replies

  • Hi Safal 
    You can use edit interaction between visuals.This is allow you to filter one visual using another.

    • Safal's avatar
      Safal
      Frequent Visitor

      hi, 

       

      I tried this one, didnt work unfortunately.

      this is the relationship if it helps. ive been tyring for hours, but not sure where to start even, cause measures doesnt seem to work on tables. 

  • Safal's avatar
    Safal
    Frequent Visitor

    to solve this, what i did was. 

    create a slicer, then added it on the bottom of the graph, then removed the graph x axis. and made it look blended with the graph. as if its the button you press, rather than the graph itself.