Forum Discussion
What's the best method for toggling data?
Thanks, Terry.
Just to reiterate to other potential helpers in case my original message wasn't clear enough: what I am after is the ability to have something that when ON = only 'Yes' records are shown; when OFF = all records are shown.
Hope someone has a suggestion!
Cheers,
Matty
You can create a new table with a single column and only one value "Show only Report weeks". Make a slicer on that field. Now you can toggle on and off "Show only Report weeks".
Now create a measure in your data table
Visible = IF(ISFILTERED(Table2[Column1]),MAX(DataTable[Report Week]) = "Yes",TRUE())
Table2[Column2] is the new single-row table.
Visible will now be true for all rows in datatable if "Show only Report weeks" isn't selected in the slicer and when "Show only Report weeks" is selected only the rows with Yes will be true.
I can't get a filter on Visible to work in visuals when its a boolean, but if you change it to 0 or 1 filters works
Visible = IF( IF( ISFILTERED(Table2[Column1]), MAX(DataTable[Report Week]) = "Yes", TRUE()),1,0)
- Matty8 years ago
Helper II
Hi thomasronn (Thomas?),
I had a similar idea and mocked something up in Excel, but I can't get it to work in Power BI.
It seems that while something like:
ISFILTERED(Table2[Column1])
Will return TRUE or FALSE to, say, a card visual, but it doesn't work when passed to a calculated column, which is a big shame.
Back to the drawing board it seems...
Cheers,
Matty
- Matty8 years ago
Helper II
Hi,
Reading up a bit more on this, it seems that calculated columns are only refreshed at query time and not at runtime.
This means that one is not able to user a slicer to influence (change) values within a table - a slicer can only act on a table.
Anyone got any other suggestions?
Cheers,
Matty
- thomasronn8 years ago
Resolver I
Create a measure on you data table
Visible = IF( IF( ISFILTERED(Table2[Column1]), MAX(DataTable[Report Week]) = "Yes", TRUE()),1,0)
Add Visible to the filters on your visual and set it filtered to 1.