Forum Discussion
Using one Field Parameter for two tables
- Anonymous2 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.
Thank you so much for the reply. In this case, if someone picks Dimension and Segment, then the second table would be segment but the first table will be blank correct?
Any way we can make it so that if someone selects Dimension and Segment, the first table is dimension and second is segment. If someone elects Item and Dimension, the first table is Item and the second is Dimension?
Thank you in advance!
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.