grouping column in google data studio - grouping

I have example data:
customer_list:
Name suburb
Cersei king-landing
Jamie king-landing
Jon winterfell
Arya winterfell
Sansa winterfell
Dany westeros
in google-data studio, what is the best way if I want to create pie chart based on total people live in suburb.
So, from my example it should be
Winterfell 50% of pie chart
king-landing 33 % of pie chart
westeros 16% of pie chart
I have some research, such as
https://datarunsdeep.com.au/blog/custom-content-grouping-data-studio
but it doesnt make sense to me, because we need to create each group. what if I have 1000++ suburbs?
I have just started to look into this product today by the way. Apologise if I don't know too much about this yet.

This does the trick:
Chart Type: Pie Chart
Dimension: suburb
Metric: suburb (Aggregation: Count)
Google Data Studio Report and a GIF to elaborate:

I'm also looking at DataStudio for the first time, so apologies if this is off the mark, but would the following work?
Click 'Add a Metric', then 'Create New Metric' (named whatever you want - for this example a nice intuitive suburb_count) and have this set to COUNT(suburb).
Then, create a pie chart with suburb as the dimension and use the suburb_count as the metric to measure this against?
Hope this gets you in the right direction. Let me know - interested to see if this worked!

Related

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-

Filtering Slicers

I have a multidimensional cube visualized in Power BI
Imagine a fact table which has a total sales amount which is filtered using slicers. Problem is when you choose some slicer's options the chart's value showing sales amount by country falls to zero.
In other words I have some junky choices in my slicer which i want to throw away and clean them. Any ideas how to do it ?
(To add some imagery to my comment)
Make sure you have used the latest version of Power BI as some versions ago (I believe it was May) they introduced filtering of your slicer visual. See the image for an example.
Cleaning up slicers is very useful and pretty easy to do, thankfully.
To give you an example of how, and why you may do this, follow this hastily put together example.;
You have a client, Fruit Land USA that sells fruit on a grand scale. They send you data about the fruits that they sell, you clean it up and sent it back as reports.
Jackson Appleman from Fruit Land USA emails you and tells you that the reports you send out are fine, but he has a special love for Apples, for some mysterious unknown reason that isn't evident by his name.
What do?
You can throw down a slicer onto the report as you normally would, but now you see apples, oranges, pears, peaches, and bananas in your slicer. You don't want this.
So what you can do is click your slicer and drag your fruit column into the "visual filters" pane on the right, and deselect everything except for apples. Congrats, Jackson will now only be able to see data related to apples for this slicer.
But oh no, Jackson Appleman has navigated to page two. He sees data for bananas, pears, peaches, apples, and oranges. He nearly vomits at the sight of these non-appley fruits.
What do?
You can forgo the slicer filter, and follow that same path, except keep scrolling down and drag that fruit column into the "report level filters" and deselect everything except for Jackson's succulent apples.
But now John has a craving for that yellow apple data. He's tired of seeing the plain, old, cliche red apples, and the bitter green apples.
What do?
You can click the tab that says 'Basic Filtering' on your fruit column inside of the filter (whether it be on the slicer or report) and change that over to advanced filtering. Depending on your data, you can choose 'is not' and hide those boring apples. Bam, Jackson Appleman, who is becoming a real jerk at this point, no longer sees the apples he isn't specifically looking for.
I could go on and on about Jackson Appleman and his tedious requests, but I think you get the point. I hope this helped you. Otherwise, I hope learning about Jackson Appleman was good enough.

How to show and hide the pie chart in Power BI

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.

Power BI - How to show next 2 days of selected date?

I'm new to Power BI and I am having difficulties. I have some slicers as filters and two chart as below:
Sample Report
The bottom chart shows data with data according to date selected in the slicers which is straight forward. E.g. The slicer selected 15-Oct-2017, the bottom chart should shows 15-Oct-2017 as well.
The upper chart should shows the next 2 days of the selected chart, i.e. data of 16&17-Oct-2017 should be shown. How do I achieve this in a dynamic way so that when slicer selection change, this chart changes accordingly?
Thanks in advance
you can achieve this by creating 2 measures like that:
NextDayValue = CALCULATE(COUNT([columnYouWantToCount]), DATEADD([DateColumn],1,day))
Next2DayValue = CALCULATE(COUNT([columnYouWantToCount]), DATEADD([DateColumn],2,day))
and then use these measure in your charts.
Hope that helps!
Problem solved.
Refer to link below for complete solution
Solution Here

Can Power BI add range selection to a Line Chart?

I'd like to build a report with power BI line chart. For there are too many values on the X-Axis, I was trying to add a range selection on the X-Axis like what amChart does.
So, I'm wondering if power BI can do this.
Also, I want to add hyperlink to each value on the X-Axis to link to related shared folder, is it doable?
For time range selection, take a look at https://app.powerbi.com/visuals and try the Advanced Time Slicer visual. It might already do what you're looking for.
For the x-axis urls, you have several approaches you can try. The easiest approach is to have a related table in your report that shows the links. Then when a user selects a datapoint in your line chart, the table would update to show the relevant links. Alternately you might try to extend the Power BI line chart with your own logic. This might be hard since Cartesian charts are more complex than other charts. You can find the line chart code here: https://github.com/Microsoft/PowerBI-visuals/blob/master/src/Clients/Visuals/cartesian/lineChart.ts
Alternately you can just write your own purpose built visual that does exactly what you want. This might actually be easier than extending the Power BI chart. You can learn how to build your own visual by looking at our wiki: https://github.com/Microsoft/PowerBI-visuals/wiki
I was thinking about this more and wanted to mention one more solution. If you're looking to show the 'last n days' of data, instead of an arbitrary range, you can add a measure in DAX that returns the last days. I have an example here: http://blogs.msdn.com/b/lukaszp/archive/2015/08/08/finding-the-latest-date-in-power-bi-desktop.aspx