How to display multi selected values of slicer in Card? - powerbi

I have one slicer and has multi select option on. I need to display the selected values of slicer in Card using measure

You can use Measure = SELECTEDVALUE(TableName[COLUMN_NAME],"No filer") -- No Filter is optional
https://learn.microsoft.com/en-us/dax/selectedvalue-function

Pravin, the important part is to create you Measure correctly, so make sure the formula you are using gets you the result you are expecting.
From Right -> Left:
1- Do a right click in order to create a new measure.
2- Visualization of a "Card"
3- Visualization of a "Slicer"
Salu2

Check out this image how to get the multi select values from a slicer on card visual

Related

How can I force only two selection out of 5 available on slicer visual?

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.

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.

Highlight selected bar in a column chart in Power BI

I have got a column chart with 79 geographies and a slicer with the 79 geographies. The column chart is NOT dependent on the slicer however there are other visualisations in the page that are dependent on the slicer.
What I would to achieve is when I select a specific geography in the slicer the bar that corresponds to that selected geography should be highlighted (i.e. a different colour fill). Can someone please let me know if it is possible to achieve.
I was able to achieve this partly by creating an independent slicer. Not coming from the table or joined to the table. I created 2 new measures, one that shows the selected value in the slicer and the second measure to give it a colour. I used this to change the data colour by using "fx" to determine the colour of the column. I am attaching the Power BI file that shows this solution for your reference.
But by doing an independent slicer my other visualisations don't update. I am wondering if it is possible to achieve this without creating an independent slicer so that my other visualisations are not affected.
Any help is greatly appreciated. Thank you.
Measure 1: Measure = SELECTEDVALUE(Locality[Locality])
Measure 2: Colour = IF(MAX(Sheet1[Locality]) = selectedvalue(Locality[Locality]),"red","blue")
Please see below the screenshot and also link to the sample .pbix file for your reference.
Sample Power BI file - https://1drv.ms/u/s!AubIV2PXG9p4gqhykbbmeMfFYlChCw?e=w6UABf
Disconnected table solution file - https://1drv.ms/u/s!AubIV2PXG9p4gql1_KvyEK82cZZDMw?e=7TAR6i
You did a great trick as I checked your solution file. But slicer not working as expected which is your issue as per your explanation. To make it work, you can just think reverse of what you have done now.
You have separated slicer value from other data, so that selecting a value in the slicer still keep all Locality in the Bar chart. But problem is, its also keeping all localities in other charts where you wants to take effect of slicer selection. Right?
If the above explanation and assumption is correct, just separate your Locality and Population column to a different island (no relation) table. And create your BAR chart from the new table. Now, if you select a value in the slicer, all charts will be filtered accordingly but the BAR chart.
Finally, apply the Color measure to FX as you implemented currently. This will work as I tried it here and got success. Following is the sample output-

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.

Filtering a visual based on number of values selected in slicer

I have a few visuals on my report that I only want to display when just one value is selected in the sliced column. I attempted to do this by creating a measure to evaluate the number of selections in the sliced column, and then used this measure as a filter in my visual. The measures I've attempted are the following:
SlicerCheck = if(calculate(distinctcount([SlicerColumn]),allselected([SlicerColumn]))=1,"Y","N")
//I set the visual filter to "is Y" in this case
And
SlicerCheck = If(HASONEVALUE('Master File'[Custom]),1)
//I set the visual filter to "is 1"
However, as seen in the attached image (based on the second measure above) Slicer Error, the visual on the top right hand side still has a display even though the SlicerCheck is blank. This is also an issue when all the values are selected in the slicer, before a filter selection is made.
Please let me know if there is a solution to this, or if I'm making a mistake.
I was able to achieve the desired outcome by using the HASONEFILTER function instead of HASONEVALUE.