Current setup:
I have a basic report with a number of charts on the page that are all controlled by once Slicer element at the top of the page.
As required, the default selection of the slicer is "All", which shows all data across the charts as is required. Once you filter on this value, the charts all filter as normal to the value of said slicer. All good so far, all working and happy with that.
Issue:
At the top of the page, I have 4 cards, these are all counts and sums. These cards behave the same way. When no value is selected in the slicer, ALL of the data in these cards is summed and counted (as you would rightly expect) and when the slicer has a value, these cards display the correct values as per the slicer selection.
This default behaviour is not what I am looking for with respect to the cards. I only want the cards to display a value when the slicer has one single selection. Multiple selections or "All" should display blank, 0, n/a or something of the sort in the cards values.
As far as I understand, the default way of handling this is to create another measure which sets "Y" or "N" and then add this in as a visual level filter, only showing values when the measure is set to Y: EG
SlicerCheck = if(calculate(distinctcount([SlicerColumn]),allselected([SlicerColumn]))=1,"Y","N")
Other options suggest using functions that are not available in Direct Query mode.
This does not work for cards by default. Does anyone know a good way to achieve this solution?
Thanks
Damon
I would approach this by adding conditions to my count and sum measures. E.g.
SumForCard = IF(HASONEVALUE([SlicerColumn]), SUM(TableName[ColumnToSum]), BLANK())
What you can do with the new feature of Field Parameters (check in Preview features):
Create a Column Called None with all blank values of ""
Create a Field Parameter to select None field as well as the other fields you want (this lets you combine the fields together into 1 Slicer).
Make Field Parameter into a Slicer.
Now you will have a Slicer with None option that will give a blank result. Select for this as the default to not show any results. Save the dashboard in this state to keep the selection this way. You can select the other fields to populate data.
Related
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
Can someone please help me get a fix for this please.
I want to let people make only two selection at a time, no more no less from the given options. The intention is to get data on matrix dynamic column based on these two selections.
Thanks
Avi
You did not make clear what the purpose of this exercise is and how the result should look like ("get data on matrix dynamic column"), but you could
Create 2 single selection slicers based on copies of your category column
Make sure they are not related to the rest of your data model
Get the selected rows via the SELECTEDVALUE() function
You may have to consider the case where both selections are the same.
This would be a feature of a slicer visual, but I don't know of any built-in or custom slicer visual that does this.
As a workaround you can show a warning and instruction to select two items, eg a big Card visual with red text and a transparent background in front of your other visuals displaying a measure like:
AreTwoCategoriesSelected =
IF (
DISTINCTCOUNT ( DimProductCategory[ProductCategoryName] ) <> 2,
"Select 2 Categories for this report",
""
)
Which might look like
and
You can't easily use the trick where you have the measure conditionally return BLANK because most evaluations of the measure will have a filter context with just one of the selected values.
Hello I am trying to raise awareness about his subject I am facing this issue, I've posted on microsoft PBI community as wel, Did you even know about this, if so, how did you do to workaround this?
https://community.powerbi.com/t5/Desktop/Beware-Misleading-behaviour-using-Select-all-or-none-selected/m-p/1982650#M749494
As stated in the post, I have just found half a paragraph hinting about this behaviour and all the people that I've talked to did not even know it behaved this way.
TL:DR. If you use the filter panel to filer a slicer (filter on this visual) in order to restrict the selection of a slicer (so your end user does not get lost in too many options or you want a dynamic slicer showing last x months, TOP N , basically any other advanced filtering optins given using this feature).
It only visually filters the slicer so if the user ends up using "select all" or even clearing the selection, all the data would be selected even the data you (as designer) wanted to filter out. Which is misleading since the end user would see the tag "all" over the slicer selection but when clicking on it it would only show the filtered out values, so they would naturally assume that "all" means just those values and not allvalues (hidden values included).
Example
there are only two values to be selected in the slicer but the select all option actally seelcts all values including hidden ones
One thing to check first, I bet you did not apply the filtered values in the filter pane on the whole page, rather you applied it only on the visual. Try to apply that on the whole page and it seems to work for me.
so, I got 3 xlsx full of data already treated, so I pretty much just got to display the data using the graphs. The problem seems to be, that Powerbi aggregates all numeric data (using: count, sum, etc.) In their community they suggest to create new measures, the thing is, in that case I HAVE TO CREATE A LOT OF MEASURES...Also, I tried to convert the data to text and even so, Powerbi counts it!!!
any help, pls?
There are several ways to tackle this:
When you pull a field into the field well for a visualisation, you can click the drop down in the field well and select "Don't summarize"
in the data model, select the column and on the ribbon select "don't summarize" as the summarization option in the Properties group.
The screenshot shows the field well option on the left and the data model options on the right, one for a numeric and one for a text field.
And, yes, you never want to use the implicit measures, i.e. the automatic calculations that Power BI creates. If you want to keep on top of what is being calculated, create your own measures, and yes, there will be many.
Edit: If by "aggregating" you are referring to the fact that text values will be grouped in a table (you don't see any duplicates), then you need to add a column with unique values to the table so all the duplicates of the text values show up. This can be done in the data source by adding an Index column, then using that Index column in the table and setting it to a very narrow with to make it invisible.
Hi everyone, I have a chart which I need that the x value (Axis) changes by changing the slicer value (this slicer is the yellow one that has all the Dims (x values)) and it comes from DimList table. For example, at the moment the chart is totalfreight by custid, but I need if I check the empid from the yellow slicer the chart value changed to totalfreight by empid. This happens for all of the slicer values.
But I don't like bridge table or any method that has a bad effect on performance because the FactTable has a billion rows and I modeled it in SSAS, tabular model and has a live connection. Thanks in advance.
I assume you're referring to the approach that uses a bridge table described in this article. I agree that you may face some performance problems given the amount of data in your model.
First of all, you should try to see if there's some other Power BI frontend functionality that you can use directly in the report, without changing your data model. Perhaps you can use Power BI bookmarks, links or maybe a custom visual?
If not, there's another approach you can use in the data model, that does not rely on bridge tables. Disclaimer: I haven't tested this - there could be other performance issues involved.
Construct a new dimension table with all the members from your individual dimensions. Ie. create a union of all EmpIDs, CustIDs, etc. Make sure you indicate the type of ID in a separate column. The table should look like this:
DimensionId MemberId
categoryid 1
categoryid 2
categoryid 3
custid 1
custid 2
custid 3
...
Let's name this table 'All Dimensions'. The table should not have any relationships to other tables (this is similar to the Parameter Table pattern.
Change your measures to apply a virtual relationship whenever something is selected on the 'All Dimensions' table, to properly filter the fact table:
SUM('factSale'[Freight])
would become:
SWITCH(
SELECTEDVALUE('All Dimensions'[DimensionId]),
"categoryid", CALCULATE(SUM('factSale'[Freight]),
KEEPFILTERS(TREATAS(VALUES('All Dimensions'[MemberId]), 'factSale'[CategoryId])),
"custid", CALCULATE(SUM('factSale'[Freight]),
KEEPFILTERS(TREATAS(VALUES('All Dimensions'[MemberId]), 'factSale'[CustId])),
"empid", CALCULATE(SUM('factSale'[Freight]),
KEEPFILTERS(TREATAS(VALUES('All Dimensions'[MemberId]), 'factSale'[EmpId])),
// ... etc. for all dimensions ...
, // Fallback, when nothing is selected on 'All Dimensions'
IF(NOT ISFILTERED('All Dimensions'[MemberId]),
SUM('factSale'[Freight])
)
)
Put the [DimensionId] column into a slicer and use the [MemberId] column as the axis on your bar chart. Note that the chart will not show anything unless exactly one item has been filtered on the [DimensionId] slicer.
Explanation: The SWITCH statement determines if any selection has been made on the [DimensionId] column of the 'All Dimensions' table. In that case, a filter is applied to the fact table, depending on which dimension has been selected, using the TREATAS function. We're using KEEPFILTERS to make sure that any existing filters made directly on the individual dimensions are kept as-is.
In case no selection has been made on the [DimensionId] column, we want to fall back to the standard measure SUM('factSale'[Freight]) but since we don't want to repeat this measure for all items on the [MemberId] column, we use IF(NOT ISFILTERED( ... to make sure that we return only a blank value, if [MemberId] is currently used on the chart axis.