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

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

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 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.

Slicing the power BI report only by slicers not images

I have a scenario where I am using date and country slicers along with maps in my report along with some stacked charts.
When I click on the map for one country it filters the data based on that country I have selected but the filter is not reflected in slicers.
Is there any way that I can use the map only to display the counts without having select, in other words, no selection allowed on the maps?
Any suggestions would be helpful.
Thanks!
Go to Format tab and select Edit Interaction option as shown in the below image. Now select your Map visual and set Filter = None in other visuals you don't like to interact when click on the Map.

How to dynamically change column source of a card to another one in Power BI

For a report in Power BI I have two column with name 'A' and 'B'. I want to show summation of values of column 'A' or 'B' in one card based on the selection of the user.
I Want to know can I change column source of a card in report view in Power BI. A simple solution is to have two cards, each one for each column. But I want one card such that the user defines source column of it.
Thanks
First you have to see if you have any data that helps you to identify if column A or B is selected.
If you havn't you can create an auxiliar table as I did to this solution like this:
Use this column to create a filter visualization
Then create the following DAX measure:
SUM = IF( SELECTEDVALUE( AuxTable[Auxiliar] ) = "A", SUM('Table'[A]), SUM('Table'[B] ) )
Don't forget to change the select options on your filter visualization to only be able to select 1 option if is necessary.
Hope it helps you.
Another possible solution without using DAX is to take advantage of Buttons and Bookmarks.
In your scenario, you could create a Button corresponding to the possible use choices. When the user click on one button it will direct to the bookmark showing the visualization calculated using that data source.
In practice, this means you will have two Cards in your report, but only one visible at a time.

Show/Hide column in Power BI Table/Matrix visual

Is there any possibility to show or hide the column in Table/Matrix visual in Power BI report by user dynamically?
For Example, I have a table view with columns COLUMN-1, COLUMN-2, COLUMN-3. Now I may have filter drop down to list all the column headers, so based on user selection (Multiple selections) Table view should get adjusted to show column values.
Since Power BI was developed based on Excel, curious to know if we are having Hide/Show column based on any condition or available in visual by default (Maybe by right-clicking on column header then show/hide it).
You can do this with the following workaround:
Create your page with the table showing both columns.
Create a bookmark, uncheck "Data"
Duplicate the page and remove the column you want to conditionally hide. Set the page as hidden.
Create a bookmark, uncheck "Data"
Add a button to the first page pointing to the 2nd bookmark
Add a button to the second page pointing to the 1st bookmark
Ensure your slicers are synced
The end user experience is they will feel like they are conditionally hiding and unhiding the column.
A bit crap and a lot of extra work but I have it working well in my implementation.
Currently it is not possible to hide columns in visual based on slicer selection, there is an idea about this issue, please vote it up.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19435267-conditional-visibility-of-a-visual-based-on-slicer
Thanks!
This is now available in Power BI with preview feature "Field Parameter". Check the May 2022 update.