Forum Discussion
Change calculated table dynamically on slicer selection
- 6 years ago
Hi Ani26 ,
Calculated tables cannot be affect dinamically by slicers, so you cannot have a dinamic calculted table on the fly to use on a visualization, however you can create a measure that makes use of a calculated table (as a variable) and then make it dinamic with the use of slicers.
I was looking at your example and didn't understood what you want to create is the Bracket part or only the filtering of the data by bit?
- 6 years ago
Hi Ani26 ,
As MFelix said, it can't create a calculated table dynamically based on slicers. But you can do it in measures. Here is my sample that you could have a try.
Month-Year = DISTINCT('Date'[Month-Year])Bracket = VAR X = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Date', 'Date'[Month-Year] = [S] ) ) RETURN SWITCH ( TRUE (), X > 0 && X < 1, "0-1", X >= 1 && X < 2, "1-2", x > 2, ">2", BLANK () )BIT = VAR BIT = SEARCH ( "BIT", MAX ( 'Table'[Attribute] ),, 1000 ) RETURN CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Date', 'Date'[Month-Year] = [S] && BIT <> 1000 ) )
Hi Ani26 ,
As MFelix said, it can't create a calculated table dynamically based on slicers. But you can do it in measures. Here is my sample that you could have a try.
Month-Year = DISTINCT('Date'[Month-Year])Bracket =
VAR X =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Date', 'Date'[Month-Year] = [S] )
)
RETURN
SWITCH (
TRUE (),
X > 0
&& X < 1, "0-1",
X >= 1
&& X < 2, "1-2",
x > 2, ">2",
BLANK ()
)
BIT =
VAR BIT =
SEARCH ( "BIT", MAX ( 'Table'[Attribute] ),, 1000 )
RETURN
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Date', 'Date'[Month-Year] = [S] && BIT <> 1000 )
)
Hello,
Im trying to do something similar by using the date selected as a cutoff date but get the values in the new column same as the original vlaues with the corresponding date if the date is before the cutoff one and zero if the date is after cutoff date. I create an additional column called B&S. When I select 31.12.2024 for example I get the values from 2023 but not the ones from 2019, 2020... Can you help me?