Forum Discussion

SpicyRamen22's avatar
SpicyRamen22
Regular Visitor
2 years ago
Solved

Using one Field Parameter for two tables

Hi Power BI folks, I was wondering if there is any way to use one field parameter for two graphs but show different results. So for example. I have Item, Dimension and Segment in a field parameter wi...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi SpicyRamen22 ,

     

    Based on your description, there is a need to adjust our test data. The data is as follows:

     

    Slicer = DATATABLE ( 
        "Slicer", STRING, "index",INTEGER,
        {
            { "Item",1 },
            { "Dimension",2 },
            { "Seqment",3 }
        }
    ) 

     

    Then we can create measures.

     

    Measure 3 = 
    var _min=MINX(ALLSELECTED('Slicer'),[Slicer])
    var _a=CALCULATE(MAX('Table (2)'[Value]),FILTER(ALLSELECTED('Table (2)'),[id] in VALUES('Table (2)'[id]) && [Attribute]=_min))
    RETURN IF(ISFILTERED('Slicer'[Slicer]) = FALSE(),BLANK(),_a)
    Measure 4 = 
    var _max=MAXX(ALLSELECTED('Slicer'),[Slicer])
    var _a= CALCULATE(MAX('Table (2)'[Value]),FILTER(ALLSELECTED('Table (2)'),[id] in VALUES('Table (2)'[id]) && [Attribute]=_max))
    RETURN 
    IF(COUNTROWS(VALUES('Slicer'[Slicer]))=1  || ISFILTERED('Slicer'[Slicer]) = FALSE(),BLANK(),_a)

     

     

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.