How do I create a slicer that only affects one column in Power BI? - powerbi

I have a table with multiple columns, I would like to add a "Previous Date Slicer" so that there is a column that will fetch data from previous dates that the user selects, but it applies this slicer to the entire table so I can't actually create a comparative column and the entire table is filled with data from the dates I have selected.
The intent is that the Previous Data Column will display the information from the previous dates I selected in the slicer column, creating a comparison. One column will have the current dates data, and the other column will have the previous dates data from dates the user specified.

you should be able to do this by "Edit Interactions" feature.
When you have the slicer highlighted you will see a "Format" pane in the top many and the first button on this page is the one you want. One you enabled "Edit Interactions" some extra icons will apear on the other objects and all object is by default set to filter. You can change the object you don't want to be filtered by the slicer to "None"

Related

Power BI Slicer Default Selection

I have a PowerBI sheet consisting of multiple visuals and one slicer. The underlying data set includes one column called "selected" consiting of either "1" or "null". I want the slicer to always be default setted to only show data where the data entries in column "selected" are equal to "1". I want that the user is still possible to modify the selection and then be able to press a button to return to the pre-selection. I found no way possible to do this. Do you guys have any idea? I am pretty new to PowerBI.
I only found a way to pre-select the whole sheet or slicer to only show values where "selected" =1 but I want the user to be able to further select data. Also I only saw solutions for pre-selected slicer based on dates (e.g. most recent date is pre-selected).
What you need to do is to preselect all filter and save "bookmark" (view tab in powerbi desktop); Then you can assign a bookmark to the button.
Read this article:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-bookmarks?tabs=powerbi-desktop

How to set last 2 months as default filter in a power bi dashboard

The user when opening the dashboard needs to see the last 2 months filtered with slicer not selected
if user select any date in slicer, then the graphic should be filtered according to the slicer (not only 2 months)
You can use the relative data filter to show the last two months of data on your report. This will track over the time without needing to update the date.
What you can then do if you need the user to put in their own date range it to use a bookmark to remove the date filter to the full date range, which the user can select.
Using two bookmarks one to clear the data range and one to show the last two months. You can layer the bookmarks and control the visuality, and even the slicer type if required.

How to remove the empty rows in the table in PowerBI?

Hi all,
I have a table in PowerBI as shown in the screenshot above. I want to remove the rows in the table where column D is empty. So in the example above, the rows that should be removed are row7,8,9,10. In Power Query Editor, I'm only able to remove the rows if the entire row is empty.
May I know how should I remove row 7-10 in PowerBI? In future, if the data for row 7-10 in column D are available, then it will be restored back. Is this possible to achieve? Any help or advice will be greatly appreciated!
You can do as #Jeroen Mostert mentioned in his comment, within Power Query, or if you are just trying to display the table as a table visual in Power BI like this...
...then you could just filter the table visual by the column with blanks within Power BI without doing anything in Power Query.
To filter the table visual:
select the table visual
then, in the Filters pane, find the section about your column named Final, and then select "is not blank" from the drop-down selection below "Show items when the value"
then click Apply filter.
This screen snip shows the table visual selected and the Filters pane visible with "is not blank" selected in its drop-down.

How to add calculated column to existing table that would ignore selected value in a slicer Power BI

I need to add calculated column that would ignore values selected in a slicer:
I tried:
all users = ALL(Sheet1[UserName])
But it gives me an error: A table of multiple values was supplied where a single value was expected.
A calculated column cannot be affected by a slicer but that's not what you seem to be referring to.
It appears you are trying to create a visual that lists all the users. For this, you can put Username on a table visual and disable the filtering from the slicer by going to the Format tab and clicking Edit interactions.
If I understand you correctly, You have to use ALL() Function by
creating new table Under the modelling tab

Creating Date Relationship in Power BI for Slicers

I'd like to slice across visuals based on dates in MS Power BI (i.e., one filter for say month will slice all visuals for that time period.
I created a date table from http://www.agilebi.com.au/power-bi-date-dimension/ to link to the date columns in each table.
I connected xlsx workbook.
Image of columns in Power BI
I added tried to edit the relationship so connect the 2 date columns. However, when I insert the filter using the date_table as values and try to use it, the visuals disappear.
Visuals are Gone
However, when I create the slicer and slice across multiple visuals, they go blank.
**I tried changing the type to "Both" but it didn't fix the problem.
The script at AgileBI.com.au creates a date table with a 'Date' field that has a data type of text. You can (surprisingly) do a relationship between 2 fields of different data types and not get an error. However, a join between a text field that contains dates, and a regular date field will mean that rows that look like they should match up do not.
You can confirm this is happening by picking a value in the 2 tables that you think should match up and seeing if they are identical. In my case, I had Tuesday, November 01, 2016 in my imported table, and 11/1/2016 in the other table. While they both represent the same date (in the US), they clearly look different. A good place to see this is in the Edit Relationship screen (and it definitely would have been helpful to include a screenshot of that in your original post).
Anyway, if the dates in your table don't match up to the corresponding (text) dates in the Date table, then when you filter to "2016" on your slicer, the visuals will all go blank.
I would recommend:
Click Edit Queries
On the left hand side, select the table of dates (called Invoked Function by the script)
Click on the header for the Date column (it will likely already be selected)
Select Transform on the ribbon
Change the Data Type from Any to Date
Click Home > Close & Apply
Hope this helps.