Reputation: 1662
I have a slicer in power bi , in which I am trying to get the all the slicer values which are after the current selection in the slicer, I am trying for a while and its not working , I have also tried to create the calculated table and its still not working for me , this is the measure which I am trying to create to get all the values after the current selection
RangeAfterSelection =
VAR SelectedQuarter = SELECTEDVALUE(Query1[from_quarter])
RETURN
CALCULATETABLE(
DISTINCT(Query1[from_quarter]),
FILTER(
ALL(Query1),
Query1[from_quarter] > SelectedQuarter &&
RIGHT(Query1[from_quarter], 4) <= "2022"
)
)
So when I try to put this measure in the table , it gives me an error of
a table of multiple values was supplied where a single value was expected
I have values in the slicer text format like this from_quarter
2011-Q1
2011-Q2
Till
2022-Q2
Data is like this
Upvotes: 0
Views: 251
Reputation: 1
You can't only rely on the text values in you slicers, you need to add a numeric value to sort like below :
and try to order the from_quarter by the FromQYYYY :
And then create two new tables to use them as the slicers:
From = SELECTCOLUMNS(
MyTable,
"From", MyTable[from_quarter],
"FromQYYYY", MyTable[FromQYYYY]
)
To = SELECTCOLUMNS(
MyTable,
"To", MyTable[from_quarter],
"ToQYYYY", MyTable[FromQYYYY]
)
Don't create any relationships between the tables :
and then create the following measure :
CheckQuarter =
VAR fromfilter = SELECTEDVALUE('From'[FromQYYYY])
VAR tofilter = SELECTEDVALUE('To'[ToQYYYY])
RETURN
IF(SELECTEDVALUE(MyTable[FromQYYYY]) >= fromfilter && SELECTEDVALUE(MyTable[ToQYYYY]) <= tofilter, 1)
Then to visualize the result, use the following :
Upvotes: 1