How to show and hide the pie chart in Power BI - powerbi

I have a requirement where I need to create the Pie Chart for all available EventTypes. For example I have following EventTypes available in my system.
Buy
Sell
Hold
Buy Back
Now if a company has only two types of EventTypes like "Buy" & "Sell" then Power Report should show only two charts and if another company has three EventTypes like "Buy", "Sell" & "Hold" then same Power BI report should show the three pie charts.
I have two approaches to achieve this.
Approach 1: Create pie chart for all possible EventTypes and show and hide the pie chart based on the EventTypes available for given company. So how I can show and hide the pie chart in this approach.
Approach 2: Thinking to create the pie chart on the fly (If possible in PowerBI) as I could have done many time in SSRS using list. If possible how can I do this?

Approach 1 should work OK, I think.
Create a chart for each of the four EventType values and write measures or use filters such that the chart values return BLANK() for non-existing EventType values.

Related

Create a column in power Bi Based upon selection

Recently I came up with this problem:
I have a table with two different codes: COD1 and COD2. I want to create in power bi bar charts and tables with this information but I want to be able to change whether if I want to see them with COD1 or COD2. I have a slicer that gives you the option of which code you want the info be displayed. I've done this before with numeric data types because you can do this with a measure, however I don't know how to make it work with non-numeric columns.
COD1
COD2
Sales
AA
A10
5
AB
B45
10
CD
D44
20
I'm not exactly sure what you're trying to achieve but if I understand you correctly, you can change columns on a bar chart by making two bar charts. One will have COD1 as an axis with Sales, and the other will have COD2 as an axis with the same sales metric.
You could then use buttons and the bookmark functionality of Power BI to seamlessly "switch" the axis. See an example below:

How can you change bookmark selection through selected value from slicer? Is it possible?

Its known that we can dynamically change measures, dimensions and filters using selected value function, but is there any way that we can change bookmarks/graphs (bar chart to pie chart) on selection of slicer value. Say for example if ID = 1 then show pie chart if all selected show bar graph?
I don't think this is currently possible.
There are a number of related requests submitted to Power BI Ideas:
Conditional hide visuals based on value
Show/Hide Visualizations based on slicer value
Visual Hide and visual Show based on Selection Slicer
conditionally hide visual based on slicer
I recommend voting for these to improve their visibility and the likelihood that Microsoft will consider implementing them in the future.

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-

Hierarchy label customization - Power BI

I have a Clustered column chart in Power BI which has a category and date on the Axis so that there's a hierarchy to view the data on. In the hierarchy view, each column in the chart has the full hierarchy name below it. I would like to have the category name once only and then the dates for each column specified instead of the dates and category name with each date repeated. So I would like for the hierarchy labels to have their own "grouping" as it were. Is anyone able to assist with this please? I don't want to pivot the data because then there's a legend that viewers of the report need to look at to see what color column matches up to which date in the chart which isn't practical.
If anyone does run into this I ended up using the Infographic Designer custom visual that I imported from the Power BI Marketplace. With this I was able to achieve what I wanted by using the "Column By" feature of the visual. This gave me multiple charts for the different groups of data I wanted to view.

How to filter value in a card based on another chart in Power BI

I have Slicer InsurType, Pie Chart Premium by Division and Card that represents Budget
On a picture below all InsurType are selected and Budget shows correct amount (101.4M).
If I choose parameter on a slicer, then the Budget value also represents correct amount (picture 2).
But now, if I click and choose value on a pie chart - then the Budget value will not be effected.
I tried to change Edit Interaction but still - no effect.
So why the Budget value is not filtered by Pie Chart selection?
I am assuming its something to do with relationship that have "BudgetDate" table and "Divisions"
Divisions table looks like this:
Any advise how should I fix this issue?
It looks like there is no way for the Premiums table to affect the BudgetData table based on your diagram (look at the way the arrows are pointing).
I'd suggest editing the relationship to allow two directional filtering by changing the "Cross filter direction" from "Single" to "Both".